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

Method testCondNoInputs

tensorflow/compiler/tests/cond_test.py:302–316  ·  view source on GitHub ↗

Verifies against `Failed precondition: Expected one input shape`.

(self)

Source from the content-addressed store, hash-verified

300 xla_context.Exit()
301
302 def testCondNoInputs(self):
303 """Verifies against `Failed precondition: Expected one input shape`."""
304
305 with self.session(), self.test_scope():
306 xla_context = control_flow_ops.XLAControlFlowContext()
307 xla_context.Enter()
308
309 for pred in True, False:
310 cond_out = control_flow_ops.cond(
311 array_ops.placeholder_with_default(pred, []),
312 lambda: constant_op.constant(2.),
313 lambda: constant_op.constant(1.))
314 self.assertEqual(int(pred) + 1., self.evaluate(cond_out))
315
316 xla_context.Exit()
317
318
319if __name__ == '__main__':

Callers

nothing calls this directly

Calls 7

sessionMethod · 0.45
test_scopeMethod · 0.45
EnterMethod · 0.45
condMethod · 0.45
constantMethod · 0.45
evaluateMethod · 0.45
ExitMethod · 0.45

Tested by

no test coverage detected