Update introyt model tutorial APIs#3895
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3895
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit 489b8a8 with merge base 046a3f3 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Pull request overview
Updates the Building Models with PyTorch Intro YouTube tutorial code to align with current PyTorch/Python best practices and remove a Softmax deprecation warning, addressing Issue #3856.
Changes:
- Specify the Softmax dimension explicitly in
TinyModelviatorch.nn.Softmax(dim=1). - Modernize module initialization by replacing Python 2-style
super(Class, self).__init__()withsuper().__init__()inTinyModel,LeNet, andLSTMTagger.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Claude finished @svekars's task in 1m 4s —— View job Review of PR #3895
LGTM — this is a clean, minimal fix that addresses exactly what issue #3856 reported. Changes look correct:
No issues found. The changes are minimal, correct, and well-scoped. |
|
CLA is signed now, and issue #3856 is assigned to me. Could a maintainer add the issue labels ( |
a9b068c to
489b8a8
Compare
Fixes #3856
Description
Updates the Building Models tutorial to use the current PyTorch API style:
dim=1for theTinyModelsoftmax layersuper(...)calls withsuper().__init__()Verification
python3 -m py_compile beginner_source/introyt/modelsyt_tutorial.pyMPLBACKEND=Agg /tmp/docathon-torch-venv/bin/python beginner_source/introyt/modelsyt_tutorial.pyChecklist
cc @subramen