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 method to turn the list of tensor into a single tensor 810 :
X = torch.stack(data)
And it works now. Thanks!