Solved by ptrblck in post #2 
              
              
                The view(-1) operation flattens the tensor, if it wasn’t already flattened as seen here: 
x = torch.randn(2, 3, 4)
print(x.shape)
> torch.Size([2, 3, 4])
x = x.view(-1)
print(x.shape)
> torch.Size([24])

It’ll modify the tensor metadata and will not create a copy of it.