MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / execute_on_main_process

Function execute_on_main_process

parallel/utils.py:23–30  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

21 """
22
23 def execute_on_main_process(self, *args, **kwargs):
24 if getattr(self, 'main_process_only', False):
25 if is_main_process():
26 return function(self, *args, **kwargs)
27 else:
28 return do_nothing(self, *args, **kwargs)
29 else:
30 return function(self, *args, **kwargs)
31
32 return execute_on_main_process
33

Callers

nothing calls this directly

Calls 2

is_main_processFunction · 0.85
do_nothingFunction · 0.85

Tested by

no test coverage detected