Move Tensor.grad back into C++

`Tensor.grad` was moved to python in #30531 to add a warning. However,
that warning has since been lowered into C++ so this wrapper is no
longer necessary.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76675

Approved by: https://github.com/albanD
This commit is contained in:
Peter Bell
2022-06-09 16:31:59 +01:00
committed by PyTorch MergeBot
parent dd620c4575
commit 7843a5e882
7 changed files with 19 additions and 36 deletions

View File

@ -23,7 +23,7 @@ class _LazyImport:
except ImportError:
# If packaging isn't installed, try and use the vendored copy
# in pkg_resources
from pkg_resources import packaging # type: ignore[attr-defined]
from pkg_resources import packaging # type: ignore[attr-defined, no-redef]
return getattr(packaging.version, self._cls_name)
def __call__(self, *args, **kwargs):