-
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.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.topic: StatisticsStatistics.Statistics.
Milestone
Description
This RFC requests to include a new API in the array API specification for the purpose of computing the cumulative product.
Overview
Based on array comparison data, the API is available in the majority of the libraries in the PyData ecosystem.
Prior art
- NumPy: https://numpy.org/doc/stable/reference/generated/numpy.cumprod.html
- PyTorch: https://pytorch.org/docs/stable/generated/torch.cumprod.html
- MXNet: https://mxnet.apache.org/versions/master/api/python/docs/api/np/generated/mxnet.np.cumprod.html
- TensorFlow: https://www.tensorflow.org/api_docs/python/tf/math/cumprod
Proposal:
def cumprod(x: array, /, *, axis: Optional[int] = None, dtype: Optional[dtype] = None) -> array
dtype
kwarg is for consistency withsum
et al
Metadata
Metadata
Assignees
Labels
API extensionAdds new functions or objects to the API.Adds new functions or objects to the API.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.topic: StatisticsStatistics.Statistics.