mlx.core.diff

目錄

mlx.core.diff#

diff(a: array, /, n: int = 1, axis: int = -1, *, stream: StreamOrDevice = None) → array#

The n-th discrete difference along the given axis.

參數:
  • a (array) -- 輸入陣列。

  • n (int, optional) -- The number of times to difference. Default: 1.

  • axis (int, optional) -- The axis along which to difference. Default: -1.

回傳值:

The n-th differences.

回傳值型別:

array