(self)
| 93 | |
| 94 | @test_util.run_deprecated_v1 |
| 95 | def testBasic(self): |
| 96 | x = constant_op.constant(1.0, name="x") |
| 97 | y = constant_op.constant(2.0, name="y") |
| 98 | |
| 99 | def true_fn(): |
| 100 | return x * 2.0 |
| 101 | |
| 102 | def false_fn(): |
| 103 | return y * 3.0 |
| 104 | |
| 105 | self._testCond(true_fn, false_fn, [x]) |
| 106 | self._testCond(true_fn, false_fn, [x, y]) |
| 107 | self._testCond(true_fn, false_fn, [y]) |
| 108 | |
| 109 | def testExternalControlDependencies(self): |
| 110 | with ops.Graph().as_default(), self.test_session(): |