-
Notifications
You must be signed in to change notification settings - Fork 118
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
Add ops.random.shuffle
#907
Conversation
…ore into add-random-shuffle
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 the PR. Yes, this is a useful op! Please also add it in keras_core/random/random.py
so we can export it to the public API and document it.
keras_core/ops/random_test.py
Outdated
|
||
self.assertFalse( | ||
np.all(x == ops.convert_to_numpy(expected)) | ||
) # seems unlikely! |
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.
Unlikely but nevertheless the test will be flaky some % of the time unless it is seeded. I recommend using a seed.
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.
Done. seed=0
has been added.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #907 +/- ##
==========================================
- Coverage 83.63% 79.80% -3.84%
==========================================
Files 318 318
Lines 28391 28420 +29
Branches 5409 5413 +4
==========================================
- Hits 23745 22680 -1065
- Misses 3147 4281 +1134
+ Partials 1499 1459 -40
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
I didn't notice that there is a path for The function and corresponding docstring have been added. EDITED: |
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.
LGTM, thank you for the contribution! The test failure is unrelated indeed, just a flake.
I believe this op could be helpful when I came across the following PR:
#884 (comment)