changing trapz to trapezoid (#61475)
Summary:
This PR resolves issue https://github.com/pytorch/pytorch/issues/52606 while also adding support for complex number
Stack from [ghstack](https://github.com/ezyang/ghstack):
* https://github.com/pytorch/pytorch/issues/61616
* https://github.com/pytorch/pytorch/issues/61615
* **https://github.com/pytorch/pytorch/issues/61475**
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61475
Reviewed By: mruberry
Differential Revision: D29794958
Pulled By: NivekT
fbshipit-source-id: 60b9c07efd47fd85b9c8178768fc7828d7b57d29