title: TensorflowLite C API input buffer layout for multidimensional tensor
body: <p>I'm having a TensorFlow model that takes inputs of shape <code>[1, 128, 1024, 2]</code>. I'd like to run inference on this model with the TensorflowLite C API.</p>
  <p>The sample code from the <code>tensorflow/lite/c/c_api.h</code> shows how to feed input into the model:</p>
  <pre><code>std::vector&lt;float&gt; inputBuffer(1 * 128 * 1024 * 2);
  
  // populate input buffer
  // ...
  
  TfLiteTensor *inputTensor = TfLiteInterpreterGetInputTensor(interpreter, 0);
  TfLiteStatus status = TfLiteTensorCopyFromBuffer(inputTensor, inputBuffer.data(), inputBuffer.size() * sizeof(float));
  </code></pre>
  <p>The question is now how to populate the input buffer correctly.</p>
  <p>Assuming I am given an array <code>float inputArray[1][128][1024][2]</code>, how do I correctly flatten this array to a one-dimensional vector that TensorflowLite can understand?</p>