-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Python IndexError of case4: paddle.optimizer.lr.PiecewiseDecay #49987
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
python/paddle/optimizer/lr.py
Outdated
if len(boundaries) > 0: | ||
pass | ||
else: | ||
raise ValueError('The boundaries cannot be empty.') | ||
|
||
if len(values) >= len(boundaries): | ||
pass | ||
else: | ||
raise ValueError( | ||
f'The length ({len(values)}) of values should >= length ({len(boundaries)}) of boundaries.' | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
调整一下if的判断,pass的逻辑可以不写,只写raise部分。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已更新。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,建议在中英文API文档里补上这句话:The values have one more element than boundaries
好的,之后会在 docs 里进行对应 PR |
PR types
Bug fixes
PR changes
APIs
Describe
Solution