Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.cumprod

Contents

jax.numpy.cumprod#

jax.numpy.cumprod(a,axis=None,dtype=None,out=None)[source]#

Cumulative product of elements along an axis.

JAX implementation ofnumpy.cumprod().

Parameters:
  • a (ArrayLike) – N-dimensional array to be accumulated.

  • axis (int |None) – integer axis along which to accumulate. If None (default), thenarray will be flattened and accumulated along the flattened axis.

  • dtype (DTypeLike |None) – optionally specify the dtype of the output. If not specified,then the output dtype will match the input dtype.

  • out (None) – unused by JAX

Returns:

An array containing the accumulated product along the given axis.

Return type:

Array

See also

Examples

>>>x=jnp.array([[1,2,3],...[4,5,6]])>>>jnp.cumprod(x)# flattened cumulative productArray([  1,   2,   6,  24, 120, 720], dtype=int32)>>>jnp.cumprod(x,axis=1)# cumulative product along axis 1Array([[  1,   2,   6],       [  4,  20, 120]], dtype=int32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp