jax.numpy.ediff1d#
- jax.numpy.ediff1d(ary, to_end=None, to_begin=None)[source]#
The differences between consecutive elements of an array.
LAX-backend implementation of
numpy.ediff1d()
.Unlike NumPy’s implementation of ediff1d,
jax.numpy.ediff1d()
will not issue an error if castingto_end
orto_begin
to the type ofary
loses precision.Original docstring below.
- Parameters:
ary (array_like) – If necessary, will be flattened before the differences are taken.
to_end (array_like, optional) – Number(s) to append at the end of the returned differences.
to_begin (array_like, optional) – Number(s) to prepend at the beginning of the returned differences.
- Returns:
ediff1d – The differences. Loosely, this is
ary.flat[1:] - ary.flat[:-1]
.- Return type:
ndarray