-
Notifications
You must be signed in to change notification settings - Fork 60
Set correct dtype when loading and saving hdf5 #2014
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
Set correct dtype when loading and saving hdf5 #2014
Conversation
|
Thank you for the PR! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2014 +/- ##
=======================================
Coverage 92.00% 92.00%
=======================================
Files 88 88
Lines 13563 13571 +8
=======================================
+ Hits 12478 12486 +8
Misses 1085 1085
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thank you for the PR! |
…_hdf5_set_the_dtype_to_float32
|
Thank you for the PR! |
…_hdf5_set_the_dtype_to_float32
|
Thank you for the PR! |
ClaudiaComito
left a comment
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 looks great, thanks a lot @Marc-Jindra !
* fixed load_hdf5 * fixed save_hdf5 * fixed different behavior in tests * test torch dtype for save_hdf5 --------- Co-authored-by: Claudia Comito <[email protected]> (cherry picked from commit 678cd47)
|
Successfully created backport PR for |
* fixed load_hdf5 * fixed save_hdf5 * fixed different behavior in tests * test torch dtype for save_hdf5 --------- (cherry picked from commit 678cd47) Co-authored-by: Marc-Jindra <[email protected]> Co-authored-by: Claudia Comito <[email protected]>
Due Diligence
Description
Until now, when saving a dndarray with
dtype=ht.int32usingsave_hdf5, the resulting h5 dataset has the typefloat32. This can be avoided by specifyingdtype=intordtype=np.int32(notht.int32ortorch.int32as those throw errors) but it should use the dtype of the dndarray by default.The same issue exists for
load_hdf5, where it does not use the type of the h5 dataset but sets it tofloat32.This PR resolves those issues, while also solving the issue of not being able to specify
dtype=ht.float32insave_hdf5.Issue/s resolved: #2004
Changes proposed:
Type of change
Bug fix (non-breaking change which fixes an issue)
Memory requirements
Performance
Does this change modify the behaviour of other functions? If so, which?
yes / no