MCPcopy Create free account
hub / github.com/OpenTalker/StyleHEAT / wrapper

Function wrapper

utils/distributed.py:36–41  ·  view source on GitHub ↗

r"""Simple function wrapper for the master function

(*args, **kwargs)

Source from the content-addressed store, hash-verified

34 r"""Apply this function only to the master GPU."""
35 @functools.wraps(func)
36 def wrapper(*args, **kwargs):
37 r"""Simple function wrapper for the master function"""
38 if get_rank() == 0:
39 return func(*args, **kwargs)
40 else:
41 return None
42 return wrapper
43
44

Callers

nothing calls this directly

Calls 1

get_rankFunction · 0.85

Tested by

no test coverage detected