Hi BikashgG, I think you could use .type() to change tensor’s type from torch.FloatTensor to torch.LongTensor.
I face a similar problem when I use this CrossEntropyLoss().
Check the official document on this loss function, there is a requirement on the type of feed-in tensor.
Hope it helps,
Peter