MariosOreo:

x = torch.randn(2,2,requires_grad=True)


It is total wrong solution
import torch
x = torch.randn(2,2,requires_grad=True)
print (x.mean(), x.std())
x= x.norm()
print (x.mean(), x.std())

Output
tensor(0.5027, grad_fn=<MeanBackward0>) tensor(0.8901, grad_fn=<StdBackward0>)
tensor(1.8406, grad_fn=<MeanBackward0>) tensor(nan, grad_fn=<StdBackward0>)