numerical integration "trapz" function. (#21610)
Summary:
This is intended to match [numpy.trapz](https://docs.scipy.org/doc/numpy/reference/generated/numpy.trapz.html): numerical integration based on the trapezoid rule.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21610
Differential Revision: D15747618
Pulled By: umanwizard
fbshipit-source-id: 8eadb2e75c9877b07592d875ca0b2cca6cb72297