TypeError: 'torch.LongTensor' object does not support indexing

I got an following error. How to get the Variable in PyTorch 0.3?

   d = []
   d.append(torch.zeros(2, 3).type(torch.LongTensor))                                                                                                                                
   d.append(torch.zeros(2, 3).type(torch.LongTensor))
   d.append(torch.zeros(2, 3).type(torch.LongTensor))
   # v = autograd.Variable(d)
   v = autograd.Variable(torch.LongTensor(d)) # TypeError: 'torch.LongTensor' object does not support indexing

Variable(torch.stack(d, 0))

3 Likes