def test_grad_refactor_simple_1(): assert C.grad_all(grad_refactor_simple_1)(2, 1) == (4, 2)
def test_grad_refactor_10(): """ test_grad_while """ assert C.grad_all(grad_refactor__while_1)(Tensor(5, dtype=ms.int32)) == (60, )
def first_derivative_all(x): """ first_derivative_all """ return grad_all(single)(x)[0]
def test_grad_refactor_4(): assert C.grad_all(grad_refactor_4)(Tensor(4, dtype=ms.int32)) == (3, )
def test_grad_refactor_6(): assert C.grad_all(grad_refactor_6)(Tensor(3, dtype=ms.int32), Tensor(2, dtype=ms.int32)) == (3, 1)
def test_grad_refactor_simple_1(): assert C.grad_all(grad_refactor_simple_1)(Tensor(2, dtype=ms.int32), Tensor(1, dtype=ms.int32)) == (4, 2)
def test_grad_refactor_2(): assert C.grad_all(grad_refactor_2)(Tensor(2, dtype=ms.int32), Tensor(3, dtype=ms.int32)) == (27, 54)
def test_grad_refactor_5(): assert C.grad_all(grad_refactor_5)(1) == (1, )
def test_grad_refactor_6(): assert C.grad_all(grad_refactor_6)(3, 2) == (3, 1)
def test_grad_refactor_3(): assert C.grad_all(grad_refactor_3)(3) == (3, )
def test_grad_refactor_4(): assert C.grad_all(grad_refactor_4)(4) == (3, )
def test_grad_refactor_2(): assert C.grad_all(grad_refactor_2)(2, 3) == (27, 54)
def test_grad_refactor_1(): assert C.grad_all(grad_refactor_1)(2, 3) == (3, 2)
def test_grad_refactor_simple_2(): assert C.grad_all(grad_refactor_simple_2)(2, 3, 0) == (7, 4, 7)
def grad_while(x): """ grad_while """ return C.grad_all(_while)(x)
def test_grad_refactor_9(): assert C.grad_all(grad_refactor_while)(3) == (6, )
def grad_for(x): """ grad_for """ return C.grad_all(_for)(x)
def test_grad_refactor_10(): """ test_grad_while """ assert C.grad_all(grad_refactor__while_1)(5) == (60, )
def test_grad_refactor_simple_2(): x = Tensor(2, dtype=ms.int32) y = Tensor(3, dtype=ms.int32) z = Tensor(0, dtype=ms.int32) assert C.grad_all(grad_refactor_simple_2)(x, y, z) == (7, 4, 7)
def test_grad_refactor_14(): assert C.grad_all(grad_refactor_14)(2, 3) == (3, 9)
def df_refactor_3(x): return C.grad_all(grad_refactor_3)(x)
def df_refactor_14(x, y): return C.grad_all(grad_refactor_14)(x, y)
def df_refactor_5(x): return C.grad_all(grad_refactor_5)(x)
def mainf(x, y): """ mainf """ return C.grad_all(mul)(x, y)
def df_refactor_while(input_x): return C.grad_all(grad_refactor_while)(input_x)
def grad_add_mul(x, y): """ grad_add_mul """ return C.grad_all(add_mul)(x, y)
def construct(self, x, y, b): return C.grad_all(self.network)(x, y, b)
def grad_if(x, y): """ grad_if """ return C.grad_all(if_test)(x, y)
def second_derivative_all(x): """ second_derivative_all """ return grad_all(first_derivative_all)(x)[0]
def f(x, y): return C.grad_all(debug_test)(x, y)