From f510d0dbc0108a90c4b0275eb761bf189ff7a7d2 Mon Sep 17 00:00:00 2001 From: arkadip-maitra Date: Sat, 18 Oct 2025 11:53:48 +0000 Subject: [PATCH] =?UTF-8?q?Clarrifying=20input=20output=20angle=20unit=20i?= =?UTF-8?q?n=20the=20docs=20for=20trigonometric=20fun=E2=80=A6=20(#161248)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …ctions Fixes #[160995](https://github.com/pytorch/pytorch/issues/160995) Modified the docs to clarify that input tensor values for torch.sin, torch.cos and torch.tan should be in radians and the output tensor values for torch.acos, torch.asin and torch.atan is in radians. Pull Request resolved: https://github.com/pytorch/pytorch/pull/161248 Approved by: https://github.com/isuruf Co-authored-by: Isuru Fernando --- torch/_torch_docs.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/torch/_torch_docs.py b/torch/_torch_docs.py index 681025f5d283..3a8c2083afac 100644 --- a/torch/_torch_docs.py +++ b/torch/_torch_docs.py @@ -253,7 +253,7 @@ add_docstr( r""" acos(input: Tensor, *, out: Optional[Tensor]) -> Tensor -Computes the inverse cosine of each element in :attr:`input`. +Returns a new tensor with the arccosine (in radians) of each element in :attr:`input`. .. math:: \text{out}_{i} = \cos^{-1}(\text{input}_{i}) @@ -1047,7 +1047,7 @@ add_docstr( r""" asin(input: Tensor, *, out: Optional[Tensor]) -> Tensor -Returns a new tensor with the arcsine of the elements of :attr:`input`. +Returns a new tensor with the arcsine of the elements (in radians) in the :attr:`input` tensor. .. math:: \text{out}_{i} = \sin^{-1}(\text{input}_{i}) @@ -1119,7 +1119,7 @@ add_docstr( r""" atan(input: Tensor, *, out: Optional[Tensor]) -> Tensor -Returns a new tensor with the arctangent of the elements of :attr:`input`. +Returns a new tensor with the arctangent of the elements (in radians) in the :attr:`input` tensor. .. math:: \text{out}_{i} = \tan^{-1}(\text{input}_{i}) @@ -3135,7 +3135,7 @@ add_docstr( r""" cos(input, *, out=None) -> Tensor -Returns a new tensor with the cosine of the elements of :attr:`input`. +Returns a new tensor with the cosine of the elements of :attr:`input` given in radians. .. math:: \text{out}_{i} = \cos(\text{input}_{i}) @@ -9940,7 +9940,8 @@ add_docstr( r""" sin(input, *, out=None) -> Tensor -Returns a new tensor with the sine of the elements of :attr:`input`. +Returns a new tensor with the sine of the elements in the :attr:`input` tensor, +where each value in this input tensor is in radians. .. math:: \text{out}_{i} = \sin(\text{input}_{i}) @@ -11357,7 +11358,8 @@ add_docstr( r""" tan(input, *, out=None) -> Tensor -Returns a new tensor with the tangent of the elements of :attr:`input`. +Returns a new tensor with the tangent of the elements in the :attr:`input` tensor, +where each value in this input tensor is in radians. .. math:: \text{out}_{i} = \tan(\text{input}_{i})