I receive: “TypeError: torch.LongTensor constructor received an invalid combination of arguments - got (map), but expected one of:” while running the “An LSTM for Part-of-Speech Tagging” example.
def prepare_sequence(seq, to_ix):
idxs = map(lambda w: to_ix[w], seq)
tensor = torch.LongTensor(idxs) <<==========  This line gives error
return autograd.Variable(tensor)
called by
inputs = prepare_sequence(training_data[0][0], word_to_ix)
Could anyone help to solve this problem?