I have the size of a is:
torch.Size([260, 1152, 8])
My goal is to convert torch.Size([260, 1152, 8]) in to dimensional matrix [260 * n].
The new shape would be [260 x (1152 * 8)].
I have the size of a is:
torch.Size([260, 1152, 8])
My goal is to convert torch.Size([260, 1152, 8]) in to dimensional matrix [260 * n].
The new shape would be [260 x (1152 * 8)].
You could try it with
x.view(260, -1)
The -1
tells view to use all remaining elements. In this way you don’t have to explicitly define all dimension sizes.
Thank you. It works.