Beispiel #1
0
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)
Beispiel #2
0
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)
Beispiel #3
0
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)
Beispiel #4
0
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)
Beispiel #5
0
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)
Beispiel #6
0
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)