Skip to content

docs: add note regarding unspecified behavior for 0d arrays in cumulative_sum #851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/array_api_stubs/_draft/statistical_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def cumulative_sum(
Parameters
----------
x: array
input array. Should have a numeric data type.
input array. Should have one or more dimensions (axes). Should have a numeric data type.
axis: Optional[int]
axis along which a cumulative sum must be computed. If ``axis`` is negative, the function must determine the axis along which to compute a cumulative sum by counting from the last dimension.

Expand Down Expand Up @@ -48,6 +48,8 @@ def cumulative_sum(
Notes
-----

- When ``x`` is a zero-dimensional array, behavior is unspecified and thus implementation-defined.

**Special Cases**

For both real-valued and complex floating-point operands, special cases must be handled as if the operation is implemented by successive application of :func:`~array_api.add`.
Expand Down
Loading