Extends warning on norm docs (#63310)
authorMike Ruberry <mruberry@devfair044.h1.fair>
Tue, 17 Aug 2021 05:22:15 +0000 (22:22 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 17 Aug 2021 05:23:45 +0000 (22:23 -0700)
Summary:
torch.norm has a couple documentation issues, like https://github.com/pytorch/pytorch/issues/44552 and https://github.com/pytorch/pytorch/issues/38595, but since it's deprecated this PR simply clarifies that the documentation (and implementation) of torch.norm maybe be incorrect. This should be additional encouragement for users to migrate to torch.linalg.vector_norm and torch.linalg.matrix_norm.

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

Reviewed By: ngimel

Differential Revision: D30337997

Pulled By: mruberry

fbshipit-source-id: 0fdcc438f36e4ab29e21e0a64709e4f35a2467ba

torch/functional.py

index 5d74664..ab8f70f 100644 (file)
@@ -1239,6 +1239,8 @@ def norm(input, p="fro", dim=None, keepdim=False, out=None, dtype=None):  # noqa
     .. warning::
 
         torch.norm is deprecated and may be removed in a future PyTorch release.
+        Its documentation and behavior may be incorrect, and it is no longer
+        actively maintained.
 
         Use :func:`torch.linalg.norm`, instead, or :func:`torch.linalg.vector_norm`
         when computing vector norms and :func:`torch.linalg.matrix_norm` when