pytorch
2fe2aa4b - Update base for Update on "Complex gradcheck logic"

Commit
4 years ago
Update base for Update on "Complex gradcheck logic" This PR adds gradcheck for complex. The logic used for complex gradcheck is described in Section 3.5.3 here: https://arxiv.org/pdf/1701.00392.pdf More concretely, this PR introduces the following changes: 1. Updates get_numerical_jacobian to take as input a scalar value for vector (v). Adds gradcheck logic for C -> C, C-> R, R -> C. For R-> C functions, only the real value of gradient is propagated. 2. Adds backward definition for `torch.complex` and also adds a test to verify the definition added. 3. Adds tests for all `torch.real`, `torch.imag`, `torch.view_as_real`, `torch.view_as_complex`, `torch.conj`. 4. Disables some tests for complex where an extra conjugation is needed (`sin`, `cos` etc.) [ghstack-poisoned]
Author
Loading