forked from huawei/mindspore2022
Modify comment of register_backward_hook
This commit is contained in:
parent
14ce0afab3
commit
63bb52b408
|
|
@ -860,7 +860,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`,
|
||||
|
|
|
|||
Loading…
Reference in New Issue