Exemplo n.º 1
0
def test_grad_image(func, motion, optimized, preserve_result, timage, tkernel,
                    conv2dstrides):
  """Test gradients of image functions."""
  # TODO: Upgrade utils.py to allow simultaneous testing of uneven args.
  tfe_utils.test_rev_tensor(func, motion, optimized, preserve_result, (0,),
                            timage, tkernel, conv2dstrides)
  tfe_utils.test_rev_tensor(func, motion, optimized, preserve_result, (1,),
                            timage, tkernel, conv2dstrides)
Exemplo n.º 2
0
def test_grad_image_pooling(func, motion, optimized, preserve_result, timage,
                            pool2dsizes, conv2dstrides):
  tfe_utils.test_rev_tensor(func, motion, optimized, preserve_result, (0,),
                            timage, pool2dsizes, conv2dstrides)
Exemplo n.º 3
0
def test_grad_tensor_broadcast(func, motion, optimized, preserve_result, s,
                               t):
  """Test gradients of functions with binary tensor inputs."""
  tfe_utils.test_rev_tensor(func, motion, optimized, preserve_result, (0, 1),
                            s, t)
Exemplo n.º 4
0
def test_grad_matmul_higherdim(func, motion, optimized, preserve_result,
                               timage1, timage2, boolean1, boolean2):
  """Test gradients of functions with binary matrix inputs."""
  tfe_utils.test_rev_tensor(func, motion, optimized, preserve_result, (0, 1),
                            timage1, timage2, boolean1, boolean2)
Exemplo n.º 5
0
def test_grad_binary_tensor(func, motion, optimized, preserve_result, t1, t2):
  """Test gradients of functions with binary tensor inputs."""
  tfe_utils.test_rev_tensor(func, motion, optimized, preserve_result, (0, 1),
                            t1, t2)
Exemplo n.º 6
0
def test_grad_unary_reduction(func, motion, optimized, preserve_result,
                              timage, boolean):
  """Test gradients of reduction functions."""
  tfe_utils.test_rev_tensor(func, motion, optimized, preserve_result, (0,),
                            timage, boolean)
Exemplo n.º 7
0
def test_grad_unary_tensor(func, motion, optimized, preserve_result, t):
  """Test gradients of functions with single tensor input."""
  tfe_utils.test_rev_tensor(func, motion, optimized, preserve_result, (0,), t)