Skip to content

Conversation

@david20571015
Copy link
Contributor

Merge torch/optim/lr_scheduler.pyi into torch/optim/lr_scheduler.py

@pytorch-bot
Copy link

pytorch-bot bot commented May 5, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/125556

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit b4780da with merge base 23e71ff (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

)
self.total_steps = total_steps
else:
elif epochs is not None and steps_per_epoch is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elif epochs is not None and steps_per_epoch is not None:
elif epochs is not None or steps_per_epoch is not None:

Copy link
Contributor Author

@david20571015 david20571015 May 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this condition should be and because both epochs and steps_per_epoch must have available value (also, the lint failed here), otherwise it will fallback to the warning at line 1986. And maybe we should check epochos is an int before positive because it will raise an exception if epochos is not comparable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janeyx99, could you please review this again? I believe there may be some errors (as described above) in your suggested change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I was going off the DeMorgan law of not epochs is None and steps_per_epoch is None but you're right the code actually intends for both of these to be defined together.

Co-authored-by: Jane (Yuan) Xu <[email protected]>
@janeyx99 janeyx99 added ciflow/trunk Trigger trunk jobs on your pull request topic: not user facing topic category labels May 6, 2024
@david20571015
Copy link
Contributor Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 3 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@janeyx99
Copy link
Contributor

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@david20571015 david20571015 deleted the lr_scheduler branch May 10, 2024 19:29
tinglvv pushed a commit to tinglvv/pytorch that referenced this pull request May 14, 2024
Merge torch/optim/lr_scheduler.pyi into torch/optim/lr_scheduler.py
Co-authored-by: Jane (Yuan) Xu <[email protected]>
Pull Request resolved: pytorch#125556
Approved by: https://github.com/janeyx99
pytorchmergebot pushed a commit that referenced this pull request Sep 17, 2024
#136185)

When stub files (`*.pyi`) were removed from `optim` (#125556, #125452), some types that existed are no longer available. This pull request adds them back.

Just for reference, these types are used in `pytorch-lightning`'s `LightningCLI`. Command line interfaces are created automatically, and having type hints make them nicer.
Pull Request resolved: #136185
Approved by: https://github.com/janeyx99
Chao1Han pushed a commit to Chao1Han/pytorch that referenced this pull request Sep 20, 2024
pytorch#136185)

When stub files (`*.pyi`) were removed from `optim` (pytorch#125556, pytorch#125452), some types that existed are no longer available. This pull request adds them back.

Just for reference, these types are used in `pytorch-lightning`'s `LightningCLI`. Command line interfaces are created automatically, and having type hints make them nicer.
Pull Request resolved: pytorch#136185
Approved by: https://github.com/janeyx99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants