Lets for the simplicity we say we have one batch in each time. and you have 20 classes.
so the output is gonna be in shape of torch.Size([1, 20]), am I correct?



 acobobby:

To compute accuracy you should first compute a softmax in order to have probabilities of each class for each sample, i.e.:
probs = torch.softmax(out, dim=1)

Then you should select the most probable class for each sample, i.e.:
winners = probs.argmax(dim=1)



But in multi lable classification you might have multi class in one time, when you do winners = probs.argmax(dim=1) you are considering just one class that I dont think is correct.