MCPcopy Create free account
hub / github.com/pytorch/pytorch / save

Method save

torch/jit/_script.py:742–751  ·  view source on GitHub ↗

r"""Save with a file-like object. save(f, _extra_files={}) See :func:`torch.jit.save ` which accepts a file-like object. This function, torch.save(), converts the object to a string, treating it as a path. DO NOT confuse these two fun

(self, f, **kwargs)

Source from the content-addressed store, hash-verified

740 return (r[0], ConstMap(r[1]))
741
742 def save(self, f, **kwargs):
743 r"""Save with a file-like object.
744
745 save(f, _extra_files={})
746
747 See :func:`torch.jit.save <torch.jit.save>` which accepts a file-like object.
748 This function, torch.save(), converts the object to a string, treating it as a path.
749 DO NOT confuse these two functions when it comes to the 'f' parameter functionality.
750 """
751 return self._c.save(str(f), **kwargs)
752
753 def _save_for_lite_interpreter(self, *args, **kwargs):
754 r"""Add (or update) the bytecode session to the script model.

Callers 15

__reduce__Method · 0.45
__reduce__Method · 0.45
write_storageMethod · 0.45
write_tensorMethod · 0.45
make_imageFunction · 0.45
make_spriteFunction · 0.45
constructMethod · 0.45
save_globalMethod · 0.45
to_folderMethod · 0.45
serialize_torch_artifactFunction · 0.45
save_model_statesFunction · 0.45
export_chrome_traceMethod · 0.45

Calls

no outgoing calls

Tested by 15

test_pickleMethod · 0.36
test_serializationMethod · 0.36
test_pickle_futureMethod · 0.36
model_sizeFunction · 0.36
save_and_loadFunction · 0.36
do_dump_modelMethod · 0.36
open_html_modelMethod · 0.36
test_mainMethod · 0.36