-
Notifications
You must be signed in to change notification settings - Fork 200
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
refactor: Nx.Random.key as deftransform #1525
Conversation
Good call! |
Co-authored-by: Jonatan Kłosko <[email protected]>
seed | ||
|
||
%Nx.Tensor{} = seed when seed.type == {:s, 64} -> | ||
Nx.bitcast(seed, {:u, 64}) |
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.
Do we really need this clause? No-one should be passing s64 now.
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.
Or do we also want to do bitcasts for f64?
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.
We do logical and with another :u64
, so that's good.
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.
I added the s64
case because there are explicit tests for this, and it has the same entropy as u64. Not sure about floats.
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.
Oh I misread the question. I think it's fair to assume seed is always an integer.
No preference on {:s, 64}
, if there are tests, then yeah, bitcast sounds good.
No description provided.