MCPcopy Create free account
hub / github.com/pytorch/tutorials / wrapper

Function wrapper

conf.py:80–91  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

78
79def call_in_subprocess(func):
80 def wrapper(*args, **kwargs):
81 result_queue = multiprocessing.Queue()
82 p = multiprocessing.Process(
83 target=call_fn, args=(func, args, kwargs, result_queue)
84 )
85 p.start()
86 p.join()
87 success, result = result_queue.get()
88 if success:
89 return result
90 else:
91 raise RuntimeError(f"Error in subprocess: {result}")
92
93 return wrapper
94

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected