array-api
array-api copied to clipboard
feat: add `cumulative_prod` specification
This PR
- resolves https://github.com/data-apis/array-api/issues/598 by adding
cumulative_prodto the specification for computing the cumulative product. - follows
cumulative_sumin matchingaxis,dtype, andinclude_initialsemantics. - as with
cumulative_sum, this specification differs from NumPy in that flattening is not the default behavior. Similar to PyTorch, anaxisargument is required if the input array has more than one dimension.
#797 is relevant here too.
Update: I've added a note similar to what's suggested for cumulative_sum in https://github.com/data-apis/array-api/pull/851.
As this PR has not received any objections since April 18, is consistent with cumulative_sum, and has been previously discussed during workgroup meeting, I'll go ahead and merge. Any further changes can be addressed in follow-up PRs.