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

Method testParallelRun

tensorflow/python/client/session_test.py:1125–1140  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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():

Callers

nothing calls this directly

Calls 8

checkedThreadMethod · 0.80
rangeFunction · 0.50
SessionMethod · 0.45
constantMethod · 0.45
EventMethod · 0.45
startMethod · 0.45
setMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected