From 9b95568dc3a81de60435ad155ec87f625f4b69a2 Mon Sep 17 00:00:00 2001 From: albanD Date: Thu, 13 May 2021 13:16:59 -0700 Subject: [PATCH] update abs forward ad formula (#58235) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/58235 this is to make the opinfo change python only Test Plan: Imported from OSS Reviewed By: ejguan Differential Revision: D28412937 Pulled By: albanD fbshipit-source-id: 1d6eb1e4baaa837c300ee8aa00b57986ba3e3eb2 --- tools/autograd/derivatives.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/autograd/derivatives.yaml b/tools/autograd/derivatives.yaml index d802262a805..4cac4d0e461 100644 --- a/tools/autograd/derivatives.yaml +++ b/tools/autograd/derivatives.yaml @@ -178,7 +178,7 @@ # in Decalarations.yaml - name: abs(Tensor self) -> Tensor self: grad * self.sgn() - result: auto_element_wise + result: handle_r_to_c(result.scalar_type(), self_t.conj() * self_p.sgn()) - name: acos(Tensor self) -> Tensor self: grad * -((-self * self + 1).rsqrt()).conj()