提交 57c00a77 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!3487 Modify comment of register_backward_hook

Merge pull request !3487 from Simson/push-to-opensource
......@@ -862,7 +862,7 @@ class Cell:
def register_backward_hook(self, fn):
"""
Set the cell backward hook function.
Set the cell backward hook function. Note that this function is only supported in Pynative Mode.
Note:
fn should be defined as following code shows, `cell_name` is the name of registered cell,
......
......@@ -251,7 +251,8 @@ class InsertGradientOf(PrimitiveWithInfer):
class HookBackward(PrimitiveWithInfer):
"""
Used as tag to hook gradient in intermediate variables.
Used as tag to hook gradient in intermediate variables. Note that this function
is only supported in Pynative Mode.
Note:
The hook function should be defined like `hook_fn(grad) -> Tensor or None`,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册