I have this tensor:
torch.tensor([[1, 1, 1],
[1, 1, 1],
[1, 1, 1],
[2, 2, 2],
[2, 2, 2],
[2, 2, 2],
[3, 3, 3],
[3, 3, 3],
[3, 3, 3]])
I want to flatten it vertically like this:
a = torch.tensor([[1, 1, 1, 2, 2, 2, 3, 3, 3,1, 1, 1, 2, 2, 2, 3, 3, 3,1, 1, 1, 2, 2, 2, 3, 3, 3]])
I have also another problem, when I reshape it by a.reshape(3,-1), the output:
tensor([[1, 1, 1, 2, 2, 2, 3, 3, 3],
[1, 1, 1, 2, 2, 2, 3, 3, 3],
[1, 1, 1, 2, 2, 2, 3, 3, 3]])
But I thought it would be:
tensor([[1, 2, 3,1, 2, 3, 1, 2, 3],
[1, 2, 3,1, 2, 3, 1, 2, 3],
[1, 2, 3, 1, 2, 3, 1, 2, 3]])
Why, and how I can get the last output?
Thank you for your help.