jax.pallas.tpu_sc.cummax

Contents

jax.pallas.tpu_sc.cummax#

jax.pallas.tpu_sc.cummax(x, *, mask=None)[source]#

Returns the cumulative max of the array along its innermost axis.

Elements from x will pass through directly to the result until the first valid value is encountered (mask[i] == True). If you would like to specify a default value for such elements instead, write x = jnp.where(mask, x, default_value) before or after calling this function.

Parameters:
  • x (Array) – An array of integers or floats.

  • mask (Array | None) – An optional array of booleans, which specifies which elements of x are eligible for the max. If None, all elements are eligible.

Return type:

Array