Solved by thecho7 in post #4 
              
              
                nn.Linear should be defined by two integers. 
In short 
data.num_classes = n instead of data.num_classes = torch.tensor([0, 1, 3, 2])