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

Method run_test

tensorflow/python/kernel_tests/cond_v2_test.py:304–330  ·  view source on GitHub ↗
(pred_value)

Source from the content-addressed store, hash-verified

302 def testNestedCond(self):
303
304 def run_test(pred_value):
305
306 def build_graph():
307 pred = array_ops.placeholder(dtypes.bool, name="pred")
308 x = constant_op.constant(1.0, name="x")
309 y = constant_op.constant(2.0, name="y")
310
311 def true_fn():
312 return 2.0
313
314 def false_fn():
315
316 def false_true_fn():
317 return x * y * 2.0
318
319 def false_false_fn():
320 return x * 5.0
321
322 return _cond(pred, false_true_fn, false_false_fn, "inside_false_fn")
323
324 return x, y, pred, true_fn, false_fn
325
326 with ops.Graph().as_default():
327 x, y, pred, true_fn, false_fn = build_graph()
328 self._testCond(true_fn, false_fn, [x, y], {pred: pred_value})
329 self._testCond(true_fn, false_fn, [x], {pred: pred_value})
330 self._testCond(true_fn, false_fn, [y], {pred: pred_value})
331
332 run_test(True)
333 run_test(False)

Callers

nothing calls this directly

Calls 4

_testCondMethod · 0.95
build_graphFunction · 0.50
as_defaultMethod · 0.45
GraphMethod · 0.45

Tested by

no test coverage detected