-1

if I have a numpy array of shape

(16, 224, 224, 6)

how can I reshape it to

(224, 224, 6*16)

so that all elements are still in the new shape? P.S.:I need a numpy answer and not an answere derived from pytorch please :)

  • Does this answer your question? [Pytorch reshape tensor dimension](https://stackoverflow.com/questions/43328632/pytorch-reshape-tensor-dimension) – ilke444 Feb 24 '20 at 22:29

1 Answers1

1

I believe you can use transpose and reshape:

a.transpose([1,2,3,0]).reshape(244,244,-1)
Quang Hoang
  • 131,600
  • 10
  • 43
  • 63