array-api icon indicating copy to clipboard operation
array-api copied to clipboard

feat: add `cumulative_prod` specification

Open kgryte opened this issue 1 year ago • 1 comments

This PR

  • resolves https://github.com/data-apis/array-api/issues/598 by adding cumulative_prod to the specification for computing the cumulative product.
  • follows cumulative_sum in matching axis, dtype, and include_initial semantics.
  • as with cumulative_sum, this specification differs from NumPy in that flattening is not the default behavior. Similar to PyTorch, an axis argument is required if the input array has more than one dimension.

kgryte avatar Apr 18 '24 10:04 kgryte

#797 is relevant here too.

asmeurer avatar Apr 23 '24 21:04 asmeurer

Update: I've added a note similar to what's suggested for cumulative_sum in https://github.com/data-apis/array-api/pull/851.

kgryte avatar Oct 31 '24 16:10 kgryte

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.

kgryte avatar Dec 12 '24 10:12 kgryte