Solved by amnbr in post #4 
              
              
                Hi! 
I have mistaken list of tensor as a simple python list. (So I have also changed the title of question.) 
The variable ‘data’ was actually a list of tensors with only one item. And I can’t create a tensor from a list of tensors using torch.Tensor() method. Hence the error. 
I used the below meth…