Hi Jakob!



 Jakob:

Why not stick to either Long or Float?


Historically, pytorch’s CrossEntropyLoss was restricted to integer
class labels for its target and did not support probabilistic “soft”
labels.  These are naturally integers, hence Long.  In contrast,
BCELoss (and its to-be-preferred sibling, BCEWithLogitsLoss)
support (and require) probabilities for target, hence Float and
Double.
However, as of pytorch version 1.10.0, CrossEntropyLoss supports
both categorical (integer) and probabilistic target values, so this
inconsistency should be gone now.
Best.
K. Frank