It is from a piece of simple code
x = torch.randn(1, 100)
criterion = nn.NLLLoss()
y = np.array([1,0])
y = torch.from_numpy(y)
y=y.long()
f1=nn.Sequential(nn.Linear(100,10),nn.ReLU(),nn.Linear(10,2),nn.LogSoftmax(dim=1))
predict=f1(x)
predict=predict.squeeze()
loss = criterion(input1,y) #error from here
print(loss)