The Core ML model specification says:
* At runtime, all data blobs are internally represented * as 5-dimensional blobs * with the shape ``[Seq_length, Batch, C, H, W]``.
So I guess that is what you're seeing here. I don't think it really matters much, since an array with shape [1, 1, 5, 232, 136] contains the exact same data as an array with shape [5, 232, 136].
Unfortunately, MLMultiArray has no "reshape" function, but I wrote a simple Swift wrapper that makes it a little easier to read from the array. You can find it in the CoreMLHelpers repo on GitHub.
Thanks for the response.
It is true that the data array is the same. However, I also want to capture the output dimension values from this shape data structure. For example, we want to assign NCHW values to my own Dimension data structure.
However, if the Shape of the MLMultiArry is not predictable, how can I know which the batch, height, width and channels are?
Based on my experiments, for different models, the structure of the shape is not consistent. Sometimes, it has the same organization as the Network compiler's print, sometimes it is different (as in the above example). So, I cannot rely on the shape to get all those NCHW values.