Hi,
You can use 3 backticks ``` to format you code properly.
I can’t really read your code at the moment but I would say the problem is that your label tensor is of type float while losses likes CrossEntropyLoss expect a type long: It expect the index of the ground truth (not a one-hot encoding of it).