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
This commit is contained in:
albanD 2021-05-13 13:16:59 -07:00 committed by Facebook GitHub Bot
parent 3c4a90ce38
commit 9b95568dc3

View file

@ -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()