Skip to content

Update Polynomial Tensor example with torch api#3884

Merged
svekars merged 3 commits into
pytorch:mainfrom
spzala:issue3879
May 8, 2026
Merged

Update Polynomial Tensor example with torch api#3884
svekars merged 3 commits into
pytorch:mainfrom
spzala:issue3879

Conversation

@spzala

@spzala spzala commented May 8, 2026

Copy link
Copy Markdown
Contributor

Fixes# #3879

Description

torch.pi available since PyTorch 1.8.0 so use it instead of extra math call.

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.

The changes made are tested and made sure that it produce the desired output.

torch.pi available since PyTorch 1.8.0 so use it instead of
extra math call.

Fixes# pytorch#3879

Signed-off-by: Sahdev Zala <spzala@us.ibm.com>
@pytorch-bot

pytorch-bot Bot commented May 8, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

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

@meta-cla meta-cla Bot added the cla signed label May 8, 2026
@spzala

spzala commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot label "docathon-2026"

@spzala

spzala commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

cc @svekars

@sekyondaMeta

Copy link
Copy Markdown
Contributor

@claude

@claude

claude Bot commented May 8, 2026

Copy link
Copy Markdown

Claude finished @sekyondaMeta's task in 33s —— View job


Reviewing PR #3884

  • Gather context and review the PR diff
  • Analyze the code changes
  • Post review feedback

Review Summary

LGTM

This is a clean, straightforward change that replaces math.pi with torch.pi and removes the now-unnecessary import math statement. The change is correct and appropriate:

  1. torch.pi has been available since PyTorch 1.8.0, and this tutorial already requires a much newer version of PyTorch, so there's no compatibility concern.
  2. The removal of import math is correct — there are no other references to math in the file.
  3. The blank line removal (going from two blank lines after the import to one) is fine and keeps things tidy.

This makes the tutorial more self-contained by using only the torch namespace, which is a better pedagogical choice for a beginner tutorial focused on PyTorch tensors.

No issues found. Good to merge.


@svekars svekars added the easy label May 8, 2026
@svekars svekars merged commit 1655d0a into pytorch:main May 8, 2026
34 checks passed
@spzala

spzala commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @svekars !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants