Solved by promach in post #8 
              
              
                Solved using this github commit 
In [11]: import torch

In [12]: a = torch.randn(4, 3, 32, 32)

In [13]: a.size()
Out[13]: torch.Size([4, 3, 32, 32])

In [14]: b = a.view(a.shape[0], -1)

In [15]: b.size()
Out[15]: torch.Size([4, 3072])

In [16]: c = torch.flatten(b)

In [17]: c.size()
Out[17]: torc…