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
Description
The Tensors (Learning PyTorch with Examples) tutorial contains outdated patterns that should be modernized.
Changes needed
Suboptimal / Outdated Patterns
torch.linspace(-math.pi, math.pi, 2000, ...)torch.linspace(-torch.pi, torch.pi, 2000, ...)Files
beginner_source/examples_tensor/polynomial_tensor.py