Solved by ThaiThien in post #3 
              
              
                >>> a = torch.rand(2,3)
>>> a

 0.6496  0.8958  0.3040
 0.2913  0.1609  0.6008
[torch.FloatTensor of size 2x3]

>>> a_flat = a.view(a.numel())
>>> a_flat

 0.6496
 0.8958
 0.3040
 0.2913
 0.1609
 0.6008
[torch.FloatTensor of size 6]