-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Fix numpy_helper to_array #6638
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
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #6638 +/- ##
==========================================
+ Coverage 57.44% 57.46% +0.02%
==========================================
Files 507 507
Lines 31612 31584 -28
Branches 3058 3046 -12
==========================================
- Hits 18158 18151 -7
+ Misses 12610 12607 -3
+ Partials 844 826 -18 ☔ View full report in Codecov by Sentry. |
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.
You can commit the suggested changes from lintrunner.
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
### Description Refactor `to_array` to simplify and fix conversion logic. - The `_to_array` function was renamed back to `to_array`, consolidating with existing logic that leverages custom dtypes. - Created an unpack_4bit helper to unpack packed 4bit dtype data, replacing usage of the 4bit->float32 conversion functions because the original logic was not actually needed. - Removed test skips because bugs were fixed. - Type casting functions for custom dtypes will be marked private in the next PR. Public versions of them will be scheduled for deprecation. (#6639) Users should use other libraries like ml_dtypes for efficient type conversion in numpy. ### Motivation and Context Fix #6604 --------- Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
### Description Refactor `to_array` to simplify and fix conversion logic. - The `_to_array` function was renamed back to `to_array`, consolidating with existing logic that leverages custom dtypes. - Created an unpack_4bit helper to unpack packed 4bit dtype data, replacing usage of the 4bit->float32 conversion functions because the original logic was not actually needed. - Removed test skips because bugs were fixed. - Type casting functions for custom dtypes will be marked private in the next PR. Public versions of them will be scheduled for deprecation. (onnx#6639) Users should use other libraries like ml_dtypes for efficient type conversion in numpy. ### Motivation and Context Fix onnx#6604 --------- Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> Signed-off-by: seungwoo-ji <seungwoo.ji@nuvilab.com>
Description
Refactor
to_array
to simplify and fix conversion logic._to_array
function was renamed back toto_array
, consolidating with existing logic that leverages custom dtypes.Motivation and Context
Fix #6604