MCPcopy Create free account
hub / github.com/pytorch/executorch / deserialize

Function deserialize

exir/serde/serialize.py:723–737  ·  view source on GitHub ↗
(
    artifact: export_serialize.SerializedArtifact,
)

Source from the content-addressed store, hash-verified

721
722
723def deserialize(
724 artifact: export_serialize.SerializedArtifact,
725) -> ep.ExportedProgram:
726 assert isinstance(artifact.exported_program, bytes)
727 exported_program_str = artifact.exported_program.decode("utf-8")
728 exported_program_dict = json.loads(exported_program_str)
729 serialized_exported_program = export_serialize._dict_to_dataclass(
730 schema.ExportedProgram, exported_program_dict
731 )
732 return ExportedProgramDeserializer().deserialize(
733 serialized_exported_program,
734 artifact.state_dict,
735 artifact.constants,
736 artifact.example_inputs,
737 )
738
739
740def save(

Callers 7

check_serdeMethod · 0.90
test_delegateMethod · 0.90
parse_etrecordFunction · 0.90
loadFunction · 0.70

Calls 3

decodeMethod · 0.45
deserializeMethod · 0.45