I know that PyTorch is primarily an auto-diff library, but I was wondering if there are also ways to integrate efficiently? Unfortunately, I couldn’t find anything when searching (probably due to the overloading of the term “integrate” in engineering contexts).
For simple things, I could probably come up with something like
def integrate(f, a, b, points):
    x = torch.linspace(a, b, points)
    area = torch.sum(f(x))*(b-a)/points
    return area

but I was wondering if there are more efficient ways to do it, maybe something similar to scipy.integrate?