From 4a9d5c2e338c612a0b4ffdb2882aead306812e6e Mon Sep 17 00:00:00 2001 From: luochao Date: Thu, 31 Jul 2025 10:34:41 +0800 Subject: [PATCH] fix code --- tutorials/source_en/debug/pynative.md | 4 ++-- tutorials/source_zh_cn/debug/pynative.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/source_en/debug/pynative.md b/tutorials/source_en/debug/pynative.md index d2ffdf07a2..1a987cade2 100644 --- a/tutorials/source_en/debug/pynative.md +++ b/tutorials/source_en/debug/pynative.md @@ -175,7 +175,7 @@ When you need to see if the backpropagation accuracy is accurate under a dynamic return x net = Net() - output = mindspore.value_and_grad(net, grad_position=(0,1))(Tensor(np.ones([1]).astype(np.float32))) + output = mindspore.value_and_grad(net, grad_position=(0,))(Tensor(np.ones([1]).astype(np.float32))) print(output) ``` @@ -184,4 +184,4 @@ When you need to see if the backpropagation accuracy is accurate under a dynamic ## More Practical Examples -Refer to [debugging case](https://www.hiascend.com/developer/blog/details/0229108045633055169). \ No newline at end of file +Refer to [debugging case](https://www.hiascend.com/developer/blog/details/0229108045633055169). diff --git a/tutorials/source_zh_cn/debug/pynative.md b/tutorials/source_zh_cn/debug/pynative.md index 26c1e5d5a6..35e37d9b14 100644 --- a/tutorials/source_zh_cn/debug/pynative.md +++ b/tutorials/source_zh_cn/debug/pynative.md @@ -175,7 +175,7 @@ def some_function(): return x net = Net() - output = mindspore.value_and_grad(net, grad_position=(0,1))(Tensor(np.ones([1]).astype(np.float32))) + output = mindspore.value_and_grad(net, grad_position=(0,))(Tensor(np.ones([1]).astype(np.float32))) print(output) ``` @@ -184,4 +184,4 @@ def some_function(): ## 更多实际案例 -参考[调试案例](https://www.hiascend.com/developer/blog/details/0229108045633055169)。 \ No newline at end of file +参考[调试案例](https://www.hiascend.com/developer/blog/details/0229108045633055169)。 -- Gitee