diff --git a/mindspore/nn/cell.py b/mindspore/nn/cell.py index 5e7e2017f5..1dbaae2fa6 100755 --- a/mindspore/nn/cell.py +++ b/mindspore/nn/cell.py @@ -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, diff --git a/mindspore/ops/operations/debug_ops.py b/mindspore/ops/operations/debug_ops.py index 066791d4df..03d9adfe8b 100644 --- a/mindspore/ops/operations/debug_ops.py +++ b/mindspore/ops/operations/debug_ops.py @@ -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`,