-
Notifications
You must be signed in to change notification settings - Fork 52
Closed
Labels
API extensionAdds new functions or objects to the API.Adds new functions or objects to the API.
Milestone
Description
This RFC requests to include a new API in the array API specification for the purpose of computing the cumulative sum.
Overview
Based on array comparison data, the API is available in all the libraries in the PyData ecosystem.
Prior art
- NumPy: https://numpy.org/doc/stable/reference/generated/numpy.cumsum.html
- PyTorch: https://pytorch.org/docs/stable/generated/torch.cumsum.html
- MXNet: https://mxnet.apache.org/versions/1.6/api/r/docs/api/mx.nd.cumsum.html
- TensorFlow: https://www.tensorflow.org/api_docs/python/tf/math/cumsum
Proposal:
def cumsum(x: array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, dtype: Optional[dtype] = None) -> array
dtype
kwarg is for consistency withsum
et al
oleksandr-pavlyk and shoyer
Metadata
Metadata
Assignees
Labels
API extensionAdds new functions or objects to the API.Adds new functions or objects to the API.