MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / save_model

Function save_model

examples/pytorch/vit/ViT-quantization/eval_engine.py:91–95  ·  view source on GitHub ↗
(args, model)

Source from the content-addressed store, hash-verified

89
90
91def save_model(args, model):
92 model_to_save = model.module if hasattr(model, 'module') else model
93 model_checkpoint = os.path.join(args.output_dir, "%s_checkpoint.bin" % args.name)
94 torch.save(model_to_save.state_dict(), model_checkpoint)
95 logger.info("Saved model checkpoint to %s", model_checkpoint)
96
97
98def setup(args):

Callers 1

trainFunction · 0.70

Calls 1

infoMethod · 0.45

Tested by

no test coverage detected