-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Added scientific notation on set_printoptions #16876
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
|
It seems it is done for a review. I am just not sure where should I add tests for this and how to test it. I just find one usage of any thoughts? |
fmassa
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 good to me, thanks a lot!
Could you just add some tests for this?
Probably following the same as in
Lines 8900 to 8903 in f032962
| # test scientific notation | |
| x = torch.tensor([1e28, 1e-28]) | |
| self.assertEqual(x.__repr__(), str(x)) | |
| self.assertExpectedInline(str(x), '''tensor([1.0000e+28, 1.0000e-28])''') |
|
thanks @fmassa for the feedback! I just added the tests for the scientific notation options. |
5bd84b1 to
2e934c7
Compare
|
Test failures llook legit: |
Added tests for scientific notation options Fixed scientific notation output. Fixed issue when sci_mode==None
95b2c56 to
823a6b3
Compare
|
thanks for the feedback @ezyang . It seems it is working now! |
facebook-github-bot
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.
@soumith is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
fmassa
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.
Thanks a lot!
This PR fixes #15683