rust-ndarray / ndarray

ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations
https://docs.rs/ndarray/
Apache License 2.0
3.56k stars 299 forks source link

Implement product_axis #1351

Closed unrenormalizable closed 4 months ago

unrenormalizable commented 8 months ago

product_axis is like sum_axis but for product. numpy has this implemented. it is the torch.prod equivalent with the dim argument. It will be good to have this implemented.

Some of the libraries I work with - mainly burn - is adding this functionality but i have to implement it for ndarray in the burn codebase.

nilgoyette commented 8 months ago

I think this is a good idea, since we have sum and sum_axis.

I was about to code it with fold_axis or map_axis, but it seems that we can use that function as a basis.

akern40 commented 4 months ago

Hello! Would love to continue contributing, and looking for some more low-hanging fruit; just submitted a PR to close this, please let me know if there's any feedback.