Solved by albanD in post #2 
              
              
                Hi, 
The target tensor is not expected to contain one hot encoding. from the doc: 
" 
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…