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

Function deserialize

exir/serde/export_serialize.py:2396–2410  ·  view source on GitHub ↗
(
    artifact: SerializedArtifact,
)

Source from the content-addressed store, hash-verified

2394
2395
2396def deserialize(
2397 artifact: SerializedArtifact,
2398) -> ep.ExportedProgram:
2399 assert isinstance(artifact.exported_program, bytes)
2400 exported_program_str = artifact.exported_program.decode("utf-8")
2401 exported_program_dict = json.loads(exported_program_str)
2402 serialized_exported_program = _dict_to_dataclass(
2403 ExportedProgram, exported_program_dict
2404 )
2405 return ExportedProgramDeserializer().deserialize(
2406 serialized_exported_program,
2407 artifact.state_dict,
2408 artifact.constants,
2409 artifact.example_inputs,
2410 )
2411
2412
2413def _canonicalize_graph(

Callers

nothing calls this directly

Calls 4

_dict_to_dataclassFunction · 0.85
decodeMethod · 0.45
deserializeMethod · 0.45

Tested by

no test coverage detected