-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Update nn_tutorial.py #2368
Update nn_tutorial.py #2368
Conversation
Fix to pytorch#1303 "add pyplot.show() in beginner tutorial." Comments to issue suggested manually commenting out pyplot.show for users not using colab. Instead, suggest change that imports colab and does nothing if user is running notebook on colab, otherwise it runs pyplot.show() (such as when running on a local machine). This way, manual editing of notebook is not required, colab users are undisturbed and local users get pyplot.show.
beginner_source/nn_tutorial.py
Outdated
import google.colab | ||
except ImportError: | ||
pyplot.show() | ||
pass |
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.
Why is pass
needed?
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.
pass is not needed given pyplot.show(). Sorry!
✅ Deploy Preview for pytorch-tutorials-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
removed unnecessary "pass" (because pyplot.show() is present).
Fix for spellcheck
@frasertajima next time please use |
Fix to #1303
"add pyplot.show() in beginner tutorial."
Comments to issue suggested manually commenting out pyplot.show for users not using colab.
Instead, suggest change that imports colab and does nothing if user is running notebook on colab, otherwise it runs pyplot.show() (such as when running on a local machine).
This way, manual editing of notebook is not required, colab users are undisturbed and local users get pyplot.show.
Fixes #1303
Description
Checklist
cc @suraj813