Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use the transposed function? from (26, 64, 48, 1) to (1, 26, 64, 48) #45

Open
yonatanbitton opened this issue Apr 12, 2021 · 3 comments

Comments

@yonatanbitton
Copy link

yonatanbitton commented Apr 12, 2021

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

@hollance
Copy link
Owner

It's already in the correct shape. You can ignore a dimension that is 1.

@yonatanbitton
Copy link
Author

Sorry - I ment from (1, 64, 48, 26) to (1, 26, 64, 48). I updated the post.

@hollance
Copy link
Owner

Easiest way is to add a transpose / permute layer to the model at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants