How to do numerical integration with pytorch similar to numpy's trapz function?
Title says it all. Is there a convenient function in pytorch that can do something like np.trapz(y, x) (integrating over the the points in x and y via trapezoidal rule)?

There is no built-in tool for that, but it should not be difficult to implement it yourself, especially using the numpy code as a guideline.
