-
Notifications
You must be signed in to change notification settings - Fork 11
gh-402: wrap NumPy RNGs to return array_api_strict Array #622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
See in action - #595 (an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sorting this @Saransh-cpp!
assert rng.key != key | ||
assert rvs.shape == (10_000,) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these not jnp.
?
|
||
if TYPE_CHECKING: | ||
from types import ModuleType | ||
|
||
from jaxtyping import Array | ||
from numpy.typing import NDArray | ||
from array_api_strict._array_object import Array as AArray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like it might get confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump
Co-authored-by: Patrick J. Roddy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
|
||
if TYPE_CHECKING: | ||
from types import ModuleType | ||
|
||
from jaxtyping import Array | ||
from numpy.typing import NDArray | ||
from array_api_strict._array_object import Array as AArray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump
@ntessore this should be ready to review whenever you are back. Merging this will un-block a bunch of PRs! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to merge this as needed for downstream PRs
Description
A new
Generator
class to run NumPy RNG functions but wrap the final result inarray_api_strict.asarray
.Refs: #402
Checks