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. Updated get_numerical_jacobian to return a jacobian with tensors containing an extra dimension whenever the input is complex. This is meant to store both wirtinger and conjugate wirtinger derivatives used later while comparing with analytical gradient.
2. Updated gradcheck logic to calculate analytical jacobian with grad_ouput vectors containing [...,1,...] and [...,1j,...]. Also added extra error message to help in debugging.
3. Updated vjp definition for `torch.view_as_real` and `torch.view_as_complex` which is used in `tensor.real` and `tensor.imag`. Also added tests for all these functions to verify correctness.
4. Disabled some tests for complex where an extra conjugation is needed (`sin`, `cos` etc.)
5. Added a test for `torch.conj`
[ghstack-poisoned]