From 8bdcd8c267bbff59c0c97198067263b202395084 Mon Sep 17 00:00:00 2001 From: chang zherui <760161589@qq.com> Date: Thu, 16 Apr 2020 16:18:47 +0800 Subject: [PATCH] modify test_cell_bprop.py ut --- tests/ut/python/pynative_mode/test_cell_bprop.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/ut/python/pynative_mode/test_cell_bprop.py b/tests/ut/python/pynative_mode/test_cell_bprop.py index 054afe36c9..da1e14974f 100644 --- a/tests/ut/python/pynative_mode/test_cell_bprop.py +++ b/tests/ut/python/pynative_mode/test_cell_bprop.py @@ -64,14 +64,15 @@ def test_grad_inline_mul_add(): class WithParameter(nn.Cell): def __init__(self): super(WithParameter, self).__init__() - self.param = Parameter(2, 'param') + self.param1 = Parameter(1, 'param1') + self.param2 = Parameter(2, 'param2') def construct(self, x, y): - return self.param * x + y + return self.param1 * self.param2 * x + y def bprop(self, x, y, out, dout): # In this test case, The user defined bprop is wrong defined purposely to distinguish from ad result - return self.param * dout, 2 * y + return self.param1 * self.param2 * dout, 2 * y def test_with_param(): with_param = WithParameter()