torch.cumulative_trapezoid
torch.cumulative_trapezoid(y, x=None, *, dx=None, dim=- 1) -> Tensor
Cumulatively computes the trapezoidal rule along "dim". By default
   the spacing between elements is assumed to be 1, but "dx" can be
   used to specify a different constant spacing, and "x" can be used
   to specify arbitrary spacing along "dim".
For more details, please read "torch.trapezoid()". The difference
   between "torch.trapezoid()" and this function is that,
   "torch.trapezoid()" returns a value for each integration, where as
   this function returns a cumulative value for every spacing within
   the integration. This is analogous to how .sum returns a value
   and .cumsum returns a cumulative sum.
Parameters:
      * y (Tensor) -- Values to use when computing the
        trapezoidal rule.
  * **x** (*Tensor*) -- If specified, defines spacing between
    values as specified above.

Keyword Arguments: