Returns float from complex angle (#36896)
Summary:
Updates angle to return a float tensor, by default, when given complex inputs. This behavior is compatible with Python, NumPy, and C++. The implementation follows the former implementation for complex abs, extracting the logic into a common function for both abs and angle.
The test for complex abs's behavior in test_type_promotion.py is updated to also test the behavior of complex angle by comparing its results to NumPy's.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36896
Differential Revision: D21170589
Pulled By: mruberry
fbshipit-source-id: f5a634aea351dd58a8376f1474fc5a6422038cbf