What's an elegant way to compare one-hot label results?
I'm trying to calculate the 'accuracy' of one-hot label encoded tensors, such that for the following example, I'd get 0.5.
tensor([[0,0,1], [1,0,0]]) == tensor([[0,0,1], [0,1,0]])

I want to know what proportion of the predictions are correctly labelled.
What's the most elegant way to achieve this with a pytorch tensor?

If I understand correctly. You want all values to match for each row to be considered as a correct prediction then it should be something like this.
(tensor([[0,0,1], [1,0,0]]) == tensor([[0,0,1], [0,1,0]])).all(dim=1).float().mean()

