mlx.core.cumprod

目錄

mlx.core.cumprod#

cumprod(a: array, /, axis: int | None = None, *, reverse: bool = False, inclusive: bool = True, dtype: Dtype | None = None, stream: StreamOrDevice = None) → array#

Return the cumulative product of the elements along the given axis.

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

  • axis (int, optional) -- Optional axis to compute the cumulative product over. If unspecified the cumulative product of the flattened array is returned.

  • reverse (bool) -- Perform the cumulative product in reverse.

  • inclusive (bool) -- The i-th element of the output includes the i-th element of the input.

  • dtype (Dtype, optional) -- Cast the input to this type before multiplying.

回傳值:

輸出陣列。

回傳值型別:

array