MCPcopy Create free account
hub / github.com/apple/axlearn / wrapper

Function wrapper

axlearn/experiments/trainer_config_utils.py:205–216  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

203
204 @wraps(func)
205 def wrapper(*args, **kwargs) -> dict[str, TrainerConfigFn]:
206 result = cached_func(get_data_dir(), *args, **kwargs)
207 new_result = {}
208 for key, fn in result.items():
209 if getattr(fn, "_is_wrapped_with_deepcopy", False):
210 # No need to wrap the function again. This can happen when a parent module
211 # recursively combines other named_trainer_configs output from its submodules.
212 new_result[key] = fn
213 else:
214 # Wrap it so that a true deepcopy with closures will happen first.
215 new_result[key] = _wrap_with_deep_copy_with_closure(fn)
216 return new_result
217
218 return wrapper

Callers

nothing calls this directly

Calls 3

get_data_dirFunction · 0.90
itemsMethod · 0.80

Tested by

no test coverage detected