ImageNet Example Accuracy Calculation

I’m a little confused as to the nature of this function’s output. Is it a list of accuracy values for each images tested or does it calculate some sort of mean of these values and output a singular value?

If it’s the former then could one achieve the latter by just returning res.mean() ?

Also can you just use topk=(3) for a top-3 accuracy for example, rather than topk=(3,)?

Thanks for any help on this.