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

Method execution_mode_test

tensorflow/python/eager/core_test.py:979–991  ·  view source on GitHub ↗
(cond, count, num_threads, ctx, mode)

Source from the content-addressed store, hash-verified

977 num_threads = 10
978
979 def execution_mode_test(cond, count, num_threads, ctx, mode):
980 cond.acquire()
981 # Ensure that all threads set their mode simultaneously
982 # Note that this is not a simple assignment, as the execution_mode is an
983 # @property with a custom setter.
984 ctx.execution_mode = mode
985 count[0] = count[0] + 1
986 if count[0] < num_threads:
987 cond.wait()
988 else:
989 cond.notify_all()
990 cond.release()
991 self.assertEqual(ctx.execution_mode, mode)
992
993 ctx = context.Context()
994 threads = []

Callers

nothing calls this directly

Calls 4

acquireMethod · 0.80
notify_allMethod · 0.80
waitMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected