MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / print_all

Function print_all

SwissArmyTransformer/sat/helpers.py:139–146  ·  view source on GitHub ↗
(msg, level=logging.INFO, flush=True)

Source from the content-addressed store, hash-verified

137 logger.log(level=level, msg=msg)
138
139def print_all(msg, level=logging.INFO, flush=True):
140 if isinstance(level, str):
141 level = getattr(logging, level.upper())
142 if torch.distributed.is_initialized():
143 msg = f"[RANK {torch.distributed.get_rank()}] {msg}"
144 logger.log(level=level, msg=msg)
145 if flush:
146 logger.handlers[0].flush()
147
148def debug_param(name, param):
149 print_all(f"param: {name}, min: {param.min()}, max: {param.max()}, mean: {param.mean()}, std: {param.std()}, scale: {param.abs().mean()}, first5: {param.flatten()[:5]}, last5: {param.flatten()[-5:]}")

Callers 8

kernels.pyFile · 0.90
get_modelFunction · 0.90
lora2.pyFile · 0.90
trainFunction · 0.90
train_stepFunction · 0.90
load_checkpointFunction · 0.90
make_dataset_fullFunction · 0.90
debug_paramFunction · 0.85

Calls 1

logMethod · 0.80

Tested by

no test coverage detected