Skip to content

Update Polynomial Tensor example — use torch.pi instead of math.pi #3879

@sekyondaMeta

Description

@sekyondaMeta

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions