Tried torch.stack and the issue TypeError: embedding(): argument 'indices' (position 2) must be Tensor, not list got solved but now there is another error in the embedding layer
  File "/home/centos/project/model_dir/lstm_model.py", line 136, in forward
    embed = self.embedding(sent)
  File "/usr/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/lib64/python3.6/site-packages/torch/nn/modules/sparse.py", line 118, in forward
    self.norm_type, self.scale_grad_by_freq, self.sparse)
  File "/usr/lib64/python3.6/site-packages/torch/nn/functional.py", line 1454, in embedding
    return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: index out of range at /pytorch/aten/src/TH/generic/THTensorEvenMoreMath.cpp:191

I am using a pretrained word2vec embedding built using Gensim.
def __init__(self, pretrained_emb, no_of_classes, hidden, no_layers):
    
    self.embedding = nn.Embedding.from_pretrained(pretrained_emb)

The error occurs at
 def forward(self, sentence, hidden):
      embed = self.embedding(sentence) #Error occurs here

Each word is embedded into a 128 dim vector. Shape of sentence is  torch.Size([11, 5]), when batch size of dataloader is 5.
Same error even with batch size = 1