(self)
| 1123 | t.join() |
| 1124 | |
| 1125 | def testParallelRun(self): |
| 1126 | with session.Session() as sess: |
| 1127 | c = constant_op.constant(5.0) |
| 1128 | ev = threading.Event() |
| 1129 | |
| 1130 | def run_step(): |
| 1131 | ev.wait() |
| 1132 | val = c.eval(session=sess) |
| 1133 | self.assertEqual(val, 5.0) |
| 1134 | |
| 1135 | threads = [self.checkedThread(target=run_step) for _ in range(100)] |
| 1136 | for t in threads: |
| 1137 | t.start() |
| 1138 | ev.set() |
| 1139 | for t in threads: |
| 1140 | t.join() |
| 1141 | |
| 1142 | @staticmethod |
| 1143 | def _build_graph(): |