The problem is that grad_target contains a single scalar value (that’s what the size [] means).
But label * output_cl is a whole vector. The gradient should be the same size as the Tensor, so a single scalar value here.