Converting a list to tensor

This won’t work, as your input has varying shapes in dim1.
You could pad the last row with some values:

a = [[1,2,3],[4,5,6],[1, 0, 0]]
b = torch.tensor(a)
6 Likes