Torch.norm & torch.linalg.norm

While using torch.norm my code is giving nans. So, I tried changing the dtype argument as mentioned here torch.norm — PyTorch 1.7.0 documentation to dtype=torch.float64.
But it is giving the following error:
ValueError: dtype argument is not supported in frobenius norm.

As mentioned as WARNING on this page as torch.norm — PyTorch 1.7.0 documentation torch.norm is deprecated and maybe removed in future release.

But the following snippet is also giving as ImportError : cannot import name 'linalg'
from torch import linalg

Please look into the issue.

Which torch version are you using?
linalg is introduced in pytorch 1.7.0 I think.

Also, can you give a short snippet of code to reproduce the issue?

I’m using torch 1.3.1 version

Even I am facing the same issue.

from torch import linalg 

gives me the error


from torch import linalg 

ImportError                               Traceback (most recent call last)
<ipython-input-11-fe7ec55944c3> in <module>
----> 1 from torch import linalg

ImportError: cannot import name 'linalg' from 'torch' (/home/nithin/anaconda3/envs/Pytorch_cuda_env/lib/python3.7/site-packages/torch/

Which PyTorch version are you using?
As given by @InnovArul it seems that this namespace was introduced in PyTorch>=1.7.

Oh. Okay.
I’m using 1.3.1.