You must wrap your tensors into Variables before passing them to the LSTM module like so:
import torch
from torch.autograd import Variable

i = Variable(torch.randn(5, 3, 10))
h0 = Variable(torch.randn(2, 3, 20))
c0 = Variable(torch.randn(2, 3, 20))

Although the Variable module will be removed in the next version of PyTorch, for now you must wrap your Tensors with it before feeding them to any model.