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
inputs = prepare_sequence(training_data, word_to_ix)
Could anyone help to solve this problem?