How to convert 3D tensor to 2D tensor in pytorch?
I am new to pytorch. I have 3D tensor (32,10,64) and I want a 2D tensor (32, 64).
I tried view() and used after passing to linear layer squeeze() which converted it to (32,10). 

Try this

t = torch.rand(32, 10, 64).permute(0, 2, 1)[:, :, -1]


or, as pointed out by Shai, you could also

t = torch.rand(32, 10, 64)[:, -1, :]


print(t.size()) # torch.Size([32, 64])

