Complete implementation of cp.random.choice()
Author: FloWsnrCreated Apr 16, 2024Updated Sep 12, 2026
Labelscontribution welcomecat:numpy-compat
Description
Hi guys,
First of all, thank you for the amazing work.
I'm interested in using cp.random.choice with replace=False as well as a given probability array.
Currently this feature is not implemented. see here
Before I just write my own version of this function, I'd like to try and add the functionality to cupy. Since this would be my first contribution to cupy, I'd like to get some starter help...
Questions:
- Are there any ongoing efforts / PRs to do that?
- The choice function for the Generator class is completely missing. Is it worth it to add the functionality to
cp.random.choiceor should I directly try to add the choice function to the Generator class? - Am I understanding the code correctly?
_sample.pyjust calls_generator.py(old random functions)_generator_api.pyxis the new Generator class
- Since I am no cuda/Cython pro: Why is the old choice function exclusively in python while the new Generator class requires Cython?
Additional Information
No response
Source: cupy/cupy