MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / __enter__

Method __enter__

monai/utils/profiling.py:270–279  ·  view source on GitHub ↗

Enter the context, creating the read thread and setting up tracing if needed.

(self)

Source from the content-addressed store, hash-verified

268 return self._trace_call
269
270 def __enter__(self):
271 """Enter the context, creating the read thread and setting up tracing if needed."""
272 self.read_thread = threading.Thread(target=self._read_thread_func)
273 self.read_thread.start()
274
275 if self.call_selector is not None:
276 threading.settrace(self._trace_call)
277 sys.settrace(self._trace_call)
278
279 return self
280
281 def __exit__(self, exc_type, exc_value, traceback):
282 """Terminate the read thread cleanly and reset tracing if needed."""

Callers

nothing calls this directly

Calls 1

startMethod · 0.45

Tested by

no test coverage detected