Skip to content

Update linspace and logspace to throw an error when steps is not provided #55951

@mruberry

Description

@mruberry

torch.linspace() and torch.logspace() currently throw warnings when not given steps:

torch.linspace(1, 10)
: UserWarning: Not providing a value for linspace's steps is deprecated and will throw a runtime error in a future release. This warning will appear only once per process. (Triggered internally at  ../aten/src/ATen/native/RangeFactories.cpp:20.)

torch.logspace(1, 10)
UserWarning: Not providing a value for logspace's steps is deprecated and will throw a runtime error in a future release. This warning will appear only once per process. (Triggered internally at  ../aten/src/ATen/native/RangeFactories.cpp:51.)

and their documentation also warns that failing to provide steps is deprecated (linspace docs, logspace docs).

We should update these operators to require steps be specified for PyTorch 1.9.

cc @gchanan @mruberry

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: deprecationmodule: tensor creationtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions