From 22f78144c70d9d215bc390805aa8d0657e548b85 Mon Sep 17 00:00:00 2001 From: Mike Ruberry Date: Mon, 16 Aug 2021 22:22:15 -0700 Subject: [PATCH] Extends warning on norm docs (#63310) 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/torch/functional.py b/torch/functional.py index 5d74664..ab8f70f 100644 --- a/torch/functional.py +++ b/torch/functional.py @@ -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 -- 2.7.4