From 85205ea80be9cbe0905c530adfb51e246b9d002f Mon Sep 17 00:00:00 2001
From: panyifeng <panyifeng@huawei.com>
Date: Thu, 16 Apr 2020 19:58:37 +0800
Subject: [PATCH] fix document example for insert_grad_of

---
 mindspore/ops/operations/debug_ops.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mindspore/ops/operations/debug_ops.py b/mindspore/ops/operations/debug_ops.py
index a69dcc2df..e4467f5ce 100644
--- a/mindspore/ops/operations/debug_ops.py
+++ b/mindspore/ops/operations/debug_ops.py
@@ -123,6 +123,7 @@ class InsertGradientOf(PrimitiveWithInfer):
         >>>     return ret
         >>>
         >>> clip = P.InsertGradientOf(clip_gradient)
+        >>> grad_all = C.GradOperation('get_all', get_all=True)
         >>> def InsertGradientOfClipDemo():
         >>>     def clip_test(x, y):
         >>>         x = clip(x)
@@ -135,7 +136,7 @@ class InsertGradientOf(PrimitiveWithInfer):
         >>>         return clip_test(x, y)
         >>>
         >>>     def fd(x, y):
-        >>>         return C.grad_all(clip_test)(x, y)
+        >>>         return grad_all(clip_test)(x, y)
         >>>
         >>>     print("forward: ", f(1.1, 0.1))
         >>>     print("clip_gradient:", fd(1.1, 0.1))
-- 
GitLab