tutorials
tutorials copied to clipboard
Update Polynomial Tensor example — use torch.pi instead of math.pi
Description
The Tensors (Learning PyTorch with Examples) tutorial contains outdated patterns that should be modernized.
Changes needed
Suboptimal / Outdated Patterns
| Issue | Current Code | Modern Alternative | Notes |
|---|---|---|---|
| Using math.pi instead of torch.pi | torch.linspace(-math.pi, math.pi, 2000, ...) |
torch.linspace(-torch.pi, torch.pi, 2000, ...) |
torch.pi available since PyTorch 1.8.0. Avoids the extra import math. |
Files
/assigntome
/assigntome
The issue is already assigned. Please pick an opened and unnasigned issue with the docathon-2026 label.
This issue has been resolved (related PR is merged) and will be closed eventually.