aesara.tensor.diff#
- aesara.tensor.diff(x, n=1, axis=-1)[source]#
Calculate the
n
-th order discrete difference along the givenaxis
.The first order difference is given by
out[i] = a[i + 1] - a[i]
along the givenaxis
, higher order differences are calculated by usingdiff
recursively. This is heavily inspired bynumpy.diff
.- Parameters:
x – Input tensor variable.
n – The number of times values are differenced, default is 1.
axis – The axis along which the difference is taken, default is the last axis.
New in version 0.6.