Yes, you should be able to use dim=3, if both tensors have the printed shape.
Are you seeing any errors using it?



 JasonChenhx:

Or I only compute the sum of each dimension first, and then average each dimension.


That might depend on your use case and what you would like to achieve, so I can’t be really helpful here.