title: How to initialize a MLMultiArray in CoreML
body: <p>I've got an array of 40 arrays with 12 double features, so the type is [[double]]. Currently I'm sending this data to Google Cloud ML API to get a related prediction.</p>
  
  <p>Since Apple recently introduced CoreML and coremltools, I converted my model from keras to .mlmodel to avoid thousand of google cloud api calls and do inference directly on my iPhone: </p>
  
  <pre><code>coreml_model = coremltools.converters.keras.convert(new_Model, input_names=['accelerations'],
                                                      output_names=['scores'])
  coreml_model.save('PredictionModel.mlmodel')
  </code></pre>
  
  <p>After adding the model to my Xcode Project, it looks like:
  <a href="https://i.stack.imgur.com/UrYoQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/UrYoQ.png" alt="enter image description here"></a></p>
  
  <p>I have no idea, where these others inputs and outputs are comming from.
  To get a prediction, I need to convert my Array of Arrays of 12 doubles to an MLMultiArray, but I don't know how to do this. Has anyone faced a similar problem? Here is my current unfinished approach:</p>
  
  <pre><code>_predictionModel = PredictionModel()
  guard let mlMultiArray = try? MLMultiArray(dataPointer: &lt;#T##UnsafeMutableRawPointer#&gt;, shape: &lt;#T##[NSNumber]#&gt;, dataType: &lt;#T##MLMultiArrayDataType#&gt;, strides: &lt;#T##[NSNumber]#&gt;, deallocator: &lt;#T##((UnsafeMutableRawPointer) -&gt; Void)?##((UnsafeMutableRawPointer) -&gt; Void)?##(UnsafeMutableRawPointer) -&gt; Void#&gt;) else {
          fatalError("Unexpected runtime error.")
      }
  guard let predictionOutput = try? _predictionModel.prediction(accelerations: mlMultiArray, lstm_1_h_in: nil, lstm_1_c_in: nil, lstm_2_h_in: nil, lstm_2_c_in: nil) else {
          fatalError("Unexpected runtime error.")
      }
  </code></pre>
  
  <p>The related documentation can be found <a href="https://developer.apple.com/documentation/coreml/mlmultiarray" rel="noreferrer">here</a>.</p>