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

!398 Fix misusing of non user function in doc example for insert_grad_of

Merge pull request !398 from penn/fix_example_doc_of_insert_grad_of
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册