Skip to content

Remove lr_scheduler.print_lr #99270

@chengscott

Description

@chengscott

📚 The doc issue

The purpose of print_lr is unclear, and arguments are undocumented.
Also, the API is counter-intuitive. For example, in python API, we do not use print('hello', verbose=False) to not print something, and here the verbose is even a required argument. Instead, the user should put an if condition before calling the print function.

Related thread: https://discuss.pytorch.org/t/how-to-use-print-lr-in-the-lr-scheduler/132420
Source: https://github.com/pytorch/pytorch/blob/master/torch/optim/lr_scheduler.py#L113-L124

Suggest a potential alternative/fix

I suggest removing that function since users can still simply get the current LR via get_last_lr and design the printing message on their own.

cc @vincentqb @jbschlosser @albanD @janeyx99

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: LrSchedulermodule: optimizerRelated to torch.optimtriagedThis 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