Given a tensor of multiple dimensions, how do I flatten it so that it has a single dimension?
Eg:
>>> t = torch.rand([2, 3, 5])
>>> t.shape
torch.Size([2, 3, 5])
Run Code Online (Sandbox Code Playgroud)
How do I flatten it to have shape:
torch.Size([30])
Run Code Online (Sandbox Code Playgroud) pytorch ×1