def test_attributes(): def f(x): return x.shape try: utils.test_reverse_array(f, 'JOINT', False, False, np.array([1.0, 2.0])) assert False except ValueError as expected: assert 'attributes are not yet supported' in str(expected)
def test_grad_binary_int(func, motion, optimized, preserve_result, a, n): """Test gradients of functions with scalar and integer input.""" utils.test_reverse_array(func, motion, optimized, preserve_result, a, n)
def test_grad_square_matrix(func, motion, optimized, preserve_result, sqm): """Test gradients of square matrix functions.""" utils.test_reverse_array(func, motion, optimized, preserve_result, sqm)
def test_grad_vector(func, motion, optimized, preserve_result, x): """Test gradients of vector functions.""" utils.test_reverse_array(func, motion, optimized, preserve_result, x)
def test_grad_ternary(func, motion, optimized, preserve_result, a, b, c): """Test gradients of three-argument scalar functions.""" utils.test_reverse_array(func, motion, optimized, preserve_result, a, b, c)
def test_grad_unary(func, motion, optimized, preserve_result, a): """Test gradients of single-argument scalar functions.""" utils.test_reverse_array(func, motion, optimized, preserve_result, a)