Ashima_Garg:

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


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?