MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / testBoundaryStop

Method testBoundaryStop

tensorflow/python/ops/gradients_test.py:151–161  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

149 self.evaluate(gz_x)
150
151 def testBoundaryStop(self):
152 # Test that we don't differentiate 'x'. The gradient function for 'x' is
153 # set explicitly to None so we will get an exception if the gradient code
154 # tries to differentiate 'x'.
155 with ops.Graph().as_default():
156 c = constant(1.0)
157 x = array_ops.identity(c)
158 y = x + 1.0
159 z = y + 1
160 grads = gradients.gradients(z, [x])
161 self.assertTrue(all(x is not None for x in grads))
162
163 @test_util.run_v1_only("b/120545219")
164 def testBoundaryContinue(self):

Callers

nothing calls this directly

Calls 5

constantFunction · 0.90
allFunction · 0.85
as_defaultMethod · 0.45
GraphMethod · 0.45
identityMethod · 0.45

Tested by

no test coverage detected