HarshRangwala:

then normalized it in float type


Hi,
I think the problem is that labels need to be in long dtype not float.



 HarshRangwala:

Expected object of scalar type Long but got scalar type Float for argument #2 'target'


This may help the problem:
loss = F.cross_entropy(out, labels.long())
This post is related RuntimeError: Expected object of scalar type Long but got scalar type Float when using CrossEntropyLoss.
Bests