CoreMLHelpers
CoreMLHelpers copied to clipboard
How to use the transposed function? from (26, 64, 48, 1) to (1, 26, 64, 48)
Hello
I have an MLMultiArray in shape (1, 64, 48, 26)
that I need to transpose to shape (1, 26, 64, 48)
.
How can I do it?
Equivalent python code:
import numpy as np
arr = np.zeros(1*64*48*26).reshape((1, 64, 48, 26))
arr_transposed = arr.transpose((0,3,1,2))
Thanks
It's already in the correct shape. You can ignore a dimension that is 1.
Sorry - I ment from (1, 64, 48, 26) to (1, 26, 64, 48). I updated the post.
Easiest way is to add a transpose / permute layer to the model at the end.