sum_every

sum_every(x, n, axis=None)[source]

Sum blocks of size n along a specified axis.

Parameters:
  • x (jnp.ndarray) – Input array.

  • n (int) – Block size to sum.

  • axis (int, optional) – Axis along which to sum (0 for rows, 1 for columns).

Returns:

Resulting summed array.

Return type:

jnp.ndarray

Raises:

ValueError – If the shape of the specified axis is not divisible by n.