diff(a, n=1, axis=-1, prepend=None, append=None)¶
Calculate the n-th discrete difference along the given axis.
- a (cupy.ndarray) – Input array.
- n (int) – The number of times values are differenced. If zero, the input is returned as-is.
- axis (int) – The axis along which the difference is taken, default is the last axis.
- prepend (int, float, cupy.ndarray) – Value to prepend to
- append (int, float, cupy.ndarray) – Value to append to
The result array.