Hi All,
I wonder how I can re-arrange a tensor to form an image in the fallowing format using torch operations that don’t affect the gradients. The input tensor is:
A= ([[[  1.,   2.],
[  3.,   4.]],
[[  5.,   6.],
[  7.,   8.]],
[[  9.,  10.],
[ 11.,  12.]],
[[ 13.,  14.],
[ 15.,  16.]]])
has shape of 4x2x2
I want to change it to an image of 4x4
[[1,2,5,6],
[3,4,7,6],
[9,10,13,14],
[11,12,15,16]]
It is like the Batch-wise rearranging. I take each channel of tensor and put it in the image. You can see the photo of what I mean.

image.jpg927×506 81.2 KB