title: ImportError: cannot import name '_assert_no_grad' from 'torch.nn.modules.loss'
body: <p>Installed PyTorch using <code>pip install torchvision</code></p>
  <p>Trying to import  <code>_assert_no_grad</code> and <code>_Loss using</code></p>
  <blockquote>
  <p>from torch.nn.modules.loss import _assert_no_grad, _Loss using</p>
  </blockquote>
  <p>Getting this error even after reinstalling the Torch and PyTorch</p>
  <blockquote>
  <p>Traceback (most recent call last):   File
  &quot;/home/ubuntu/Project/Segmentation/pytorch-discriminative-loss/src/loss.py&quot;,
  line 7, in 
  from torch.nn.modules.loss import _assert_no_grad, _Loss ImportError: cannot import name '_assert_no_grad' from
  'torch.nn.modules.loss'
  (/home/ubuntu/anaconda3/lib/python3.8/site-packages/torch/nn/modules/loss.py)</p>
  </blockquote>
  <p>N. B. - torch version = 1.7.0 and torchvision = 0.8.1</p>