Hi,
The target tensor is not expected to contain one hot encoding. from the doc 32:
"
The criterion only considers a contiguous block of non-negative targets that starts at the front.
This allows for different samples to have variable amounts of target classes
"
It should contain label values and be padded by -1s. For example if you have 3 labels and sample 0 is 0, 1 and sample 1 is 2 and sample 2 is 0,1,2:
label = [[0, 1, -1],
             [2, -1, -1],
             [0, 1, 2]]

This is a old design choice (the cpu code is >7years old and is part of the first commit on github, so it’s most certainly older than that), I’m not sure why this was made though.