I’ve given the code in my previous code:
out = out.mean([2, 3])

This will calculate the mean in dim2 and dim2 and return a 2-dimensional tensor, which should then (based on the paper desciption) contain the class logits in the channel dimension (dim1).