Closed
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