so this is my code
sentence = tokenize(sentence)
X = bag_of_words(sentence,all_words)
X = X.reshape(1,X.shape[0])
X = torch.from_numpy(X).to(device)

and this is the error given
AttributeError: ‘NoneType’ object has no attribute ‘shape’