When I try this, I get the following error:
RuntimeError: Boolean value of Tensor with more than one value is ambiguous
Here are my logits
tensor([[-2.8443, -3.3110, -2.5216,  ..., -2.7601, -3.0928, -2.9031],
        [-2.8533, -2.9637, -2.5839,  ..., -2.3841, -2.8846, -3.0366],
        [-2.8923, -3.2757, -2.6118,  ..., -2.4875, -2.7701, -3.1466],
        ...,
        [-2.9981, -3.2178, -2.5539,  ..., -2.7732, -3.0216, -2.8305],
        [-2.7969, -3.0189, -2.4602,  ..., -2.2811, -2.9239, -3.1404],
        [-2.8644, -2.9294, -2.5960,  ..., -2.4510, -2.8790, -2.9344]],
       grad_fn=<IndexBackward>)

and labels
tensor([[0, 0, 0,  ..., 0, 1, 0],
        [0, 0, 0,  ..., 0, 1, 0],
        [0, 0, 0,  ..., 1, 0, 0],
        ...,
        [0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 0],
        [0, 0, 0,  ..., 0, 0, 1]])

tensors of shape batch by classes. What am I doing wrong?