I tried this code.
import torch


def normalize(x):
    x_normed = x / x.max(0, keepdim=True)
    return x_normed


t = torch.tensor([[0.0, 2, 3], [5, 10, 15], [10, 20, 30]])
print(normalize(t))


This was the error.
Traceback (most recent call last):
  File "/home/somnath/Code/ml/src/test.py", line 7, in <module>
    print(normalize(t))
  File "/home/somnath/Code/ml/src/test.py", line 3, in normalize
    x_normed = x / x.max(0, keepdim=True)
TypeError: div() received an invalid combination of arguments - got (tuple), but expected one of:
 * (Tensor other)
      didn't match because some of the arguments have invalid types: (!tuple!)
 * (float other)
      didn't match because some of the arguments have invalid types: (!tuple!)

How to correct this?