Skip to content

fix: replace torch.functional import with preferred torch.nn.functional#3756

Merged
svekars merged 1 commit intopytorch:mainfrom
vinayaksodar:patch-1
Feb 2, 2026
Merged

fix: replace torch.functional import with preferred torch.nn.functional#3756
svekars merged 1 commit intopytorch:mainfrom
vinayaksodar:patch-1

Conversation

@vinayaksodar
Copy link
Copy Markdown
Contributor

@vinayaksodar vinayaksodar commented Jan 30, 2026

Fixes #3755

Description

replace invalid torch.functional import with torch.nn.functionalv

Checklist

  • The issue that is being fixed is referred in the description (see above "Fixes #ISSUE_NUMBER")
  • 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 @zou3519 @albanD @jbschlosser

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Jan 30, 2026

🔗 Helpful Links

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

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

✅ No Failures

As of commit ded702b with merge base f3d9750 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Jan 30, 2026

Hi @vinayaksodar!

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!

@svekars svekars added the core Tutorials of any level of difficulty related to the core pytorch functionality label Jan 30, 2026
@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Jan 30, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Jan 30, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the cla signed label Jan 30, 2026
@svekars svekars requested a review from zou3519 January 30, 2026 20:29
@zou3519
Copy link
Copy Markdown
Contributor

zou3519 commented Jan 30, 2026

@svekars is there CI on this? I would have expected that we caught this before. If the answer is that there is no CI on this, then I would check this out locally and see if it actually runs. NB: I'm going to be sporadic for a couple of days

Copy link
Copy Markdown
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

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

if it works both ways then nn.functional as F is preferred

@svekars svekars changed the title fix: replace invalid torch.functional import with torch.nn.functional fix: replace torch.functional import with preferred torch.nn.functional Feb 2, 2026
@svekars svekars merged commit a5d2a6d into pytorch:main Feb 2, 2026
36 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed core Tutorials of any level of difficulty related to the core pytorch functionality functorch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] - Incorrect import: torch.functional used instead of torch.nn.functional

3 participants