Thanks for the hint. I run it again acoording to your suggestion and the result makes more sense now. However, max is still very slow compare to the other operations, do you know why? Here is the new result:
Wrote profile results to test.py.lprof
Timer unit: 1e-06 s

Total time: 0.306049 s
File: test.py
Function: test at line 14

Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
    14                                           @profile
    15                                           def test():
    16       100        23100    231.0      7.5      a = x + 0.123
    17       100        19004    190.0      6.2      b = torch.mean(x)
    18       100        18352    183.5      6.0      c = torch.sum(x)
    19       100       245593   2455.9     80.2      d = torch.max(x)