(
artifact: SerializedArtifact,
)
| 2394 | |
| 2395 | |
| 2396 | def 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 | |
| 2413 | def _canonicalize_graph( |
nothing calls this directly
no test coverage detected