How to calculate tensor mean?

image

I want to calculate mean by y-axis, so the output should be 1x3.
How should I do?

Thank you.

import torch
x = torch.rand(3, 3)
print(x.mean(1))
1 Like

x.mean(0) was what I wanted.
Thank you so much^^!!