Hi, I am a bit confused about the accuracy on multi label classification.
I have this function for calculating accuracy:
def calculate_accuracy(output, target):
    "Calculates accuracy"
    output = output.data.max(dim=1,keepdim=True)[1]
    output = output == 1.0
    output = torch.flatten(output)
    target = target == 1.0
    target = torch.flatten(target)
    return torch.true_divide((target == output).sum(dim=0), output.size(0)).item() 

but when I run it, it gives wrong outputs. For example:
x = torch.tensor([[2],[0],[1],[3],[4],[1]])
y = torch.tensor([[2],[1],[1],[4],[3],[2]])

calculate_accuracy(x,y) prints 0.6667… where it clearly should print 0.333.
Where have I mess up ?