Skip to content

Update introyt model tutorial APIs#3894

Closed
Vasanthadithya-mundrathi wants to merge 1 commit into
pytorch:mainfrom
Vasanthadithya-mundrathi:codex/docathon-3856-models-modernize
Closed

Update introyt model tutorial APIs#3894
Vasanthadithya-mundrathi wants to merge 1 commit into
pytorch:mainfrom
Vasanthadithya-mundrathi:codex/docathon-3856-models-modernize

Conversation

@Vasanthadithya-mundrathi
Copy link
Copy Markdown

Fixes #3856

Description

Updates the Building Models tutorial to use the current PyTorch API style:

  • specifies dim=1 for the TinyModel softmax layer
  • replaces Python 2-style super(...) calls with super().__init__()

Verification

  • python3 -m py_compile beginner_source/introyt/modelsyt_tutorial.py
  • MPLBACKEND=Agg /tmp/docathon-torch-venv/bin/python beginner_source/introyt/modelsyt_tutorial.py

Checklist

  • The issue that is being fixed is referred in the description
  • Only one issue is addressed in this pull request
  • Labels from the issue that this PR is fixing are added to this pull request
  • No unnecessary issues are included into this pull request.

cc @subramen

Copilot AI review requested due to automatic review settings May 12, 2026 17:36
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 12, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3894

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented May 12, 2026

Hi @Vasanthadithya-mundrathi!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Intro YouTube “Building Models with PyTorch” tutorial code to align with current PyTorch/Python API expectations and eliminate common warnings from deprecated usage.

Changes:

  • Updated TinyModel to use torch.nn.Softmax(dim=1) to avoid implicit-dimension deprecation warnings.
  • Replaced legacy Python 2-style super(Class, self).__init__() with super().__init__() in TinyModel, LeNet, and LSTMTagger.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Vasanthadithya-mundrathi
Copy link
Copy Markdown
Author

Closing in favor of #3895.

@Vasanthadithya-mundrathi Vasanthadithya-mundrathi deleted the codex/docathon-3856-models-modernize branch May 12, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Intro YouTube Building Models tutorial — Softmax dim, super() style

2 participants