MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / _func_wrapper

Function _func_wrapper

python/paddle/distributed/spawn.py:374–389  ·  view source on GitHub ↗
(func, args, error_queue, return_queue, env_dict, backend)

Source from the content-addressed store, hash-verified

372
373
374def _func_wrapper(func, args, error_queue, return_queue, env_dict, backend):
375 try:
376 # config subprocess environment variables
377 _remove_risky_env()
378 _set_trainer_env(env_dict, backend)
379 # execute function
380 result = func(*args)
381 # record function return value
382 return_queue.put(result)
383 except KeyboardInterrupt:
384 pass
385 except Exception:
386 import traceback
387
388 error_queue.put(traceback.format_exc())
389 sys.exit(1)
390
391
392class MultiprocessContext:

Callers

nothing calls this directly

Calls 5

_remove_risky_envFunction · 0.85
_set_trainer_envFunction · 0.85
exitMethod · 0.80
funcFunction · 0.50
putMethod · 0.45

Tested by

no test coverage detected