cumsum
¶
cumsum(x: array, axis: int = 0) -> array
Cumulative sum of x along axis, with a leading zero: the output
has one more element than x along axis (e.g. to turn counts into
pointers/offsets).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
array
|
The input array. |
required |
axis
|
int
|
The axis along which to sum. Default: |
0
|
Returns:
| Type | Description |
|---|---|
array
|
An array whose size along |
Example:
Source code in mlx_graphs/utils/indexing.py
from mlx_graphs.utils import cumsum · mlx_graphs/utils/indexing.py