MCPcopy Create free account
hub / github.com/pytorch/pytorch / CompleteInTimeOrDie

Function CompleteInTimeOrDie

caffe2/python/timeout_guard.py:97–104  ·  view source on GitHub ↗
(timeout_secs)

Source from the content-addressed store, hash-verified

95
96@contextlib.contextmanager
97def CompleteInTimeOrDie(timeout_secs):
98 watcher = WatcherThread(timeout_secs)
99 watcher.start()
100 yield
101 watcher.completed = True
102 watcher.condition.acquire()
103 watcher.condition.notify()
104 watcher.condition.release()
105
106
107def EuthanizeIfNecessary(timeout_secs=120):

Callers

nothing calls this directly

Calls 4

WatcherThreadClass · 0.85
startMethod · 0.45
acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…