Yes, it works. But still can’t use it directly with loss functions like CrossEntropyLoss and NLLLoss which expects it’s target to be of dimension (N, ) and not (N, 1).  The target has to be reshaped back to its original (N, ) shape