-
Couldn't load subscription status.
- Fork 7.2k
Switch from np.frombuffer to torch.frombuffer #4578
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
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.
@lc0 Thanks a lot for the quick PR. Overall it looks great. I believe you removed the use of numpy frombuffer from all places.
@pmeier there is one more below, do you think it's worth changing it?
vision/torchvision/datasets/mnist.py
Line 516 in a485b8c
| parsed = np.frombuffer(data, dtype=m[1], offset=(4 * (nd + 1))) |
I think we can also refactor that use-case. I was just not sure if we loose readability by doing so or no. So what do you think @pmeier |
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 @lc0, looks good to me.
|
Hey @prabhat00155! You merged this PR, but no labels were added. |
Yes, I think so. I'll send a PR. |
Summary: Co-authored-by: Prabhat Roy <[email protected]> Reviewed By: fmassa Differential Revision: D31649965 fbshipit-source-id: bac1178be3902694af3b2b3d195e0abfe0d640e5
Co-authored-by: Prabhat Roy <[email protected]>
Co-authored-by: Prabhat Roy <[email protected]>
Accordingly to pytorch/pytorch#59077 this PR migrates from np.frombuffer to pytorch.frombuffer and closes #4552
cc @pmeier