-
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
add control/status API #37885
add control/status API #37885
Conversation
Thanks for your contribution! |
python/paddle/framework/framework.py
Outdated
|
||
def is_grad_enabled(): | ||
""" | ||
Returns currently dygraph gradient calculation mode which is enabled. |
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.
English:
“Returns whether current dygraph gradient calculation mode is enabled”
Or "Returns whether dygraph gradient calculation mode is enabled currently"
- "Current" is adj. "Currently" is adv. So you could say "current mode" but not "currently mode".
- 用“Whether“表示是否。你上面的英语里which是修饰作用。所以你那句的英语意思是:”Return .... mode which is .... “, which修饰mode。你上面的英语意思是返回一个mode。
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.
done
|
||
import paddle | ||
|
||
paddle.is_grad_enabled() # True |
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.
You could add comment "Dygraph gradient calculation mode is enabled by default."
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.
done
@@ -16,6 +16,7 @@ | |||
from .attribute import shape # noqa: F401 | |||
from .attribute import real # noqa: F401 | |||
from .attribute import imag # noqa: F401 | |||
from .attribute import is_floating_point # noqa: F401 |
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.
I checked the code of is_floating_point
, do we have to add API document for this?
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.
done
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
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.
LG API
PR types
New features
PR changes
APIs
Describe
新增控制/状态类API:
paddle.is_floating_point
;paddle.Tensor.is_floating_point
;paddle.is_grad_enabled
;中文文档:
英文文档: