Now there is:


prediction_one_hot:

tensor([[0, 1],
        [0, 1],
        [1, 0],
        [0, 1],
        [0, 1],
        [0, 1],
        [0, 1],
        [1, 0]], dtype=torch.uint8)


label_one_hot

tensor([[0, 1],
        [1, 0],
        [1, 0],
        [0, 1],
        [0, 1],
        [0, 1],
        [0, 1],
        [1, 0]])

Then how can I compute the accuracy?
This problem should not be difficult, but I have been thinking for a long time and can’t think of it. I thought there maybe a function for tensor in PyTorch can work, but I did not find that here 2.