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

Function update_to_real_program

exir/program/_fake_program.py:60–67  ·  view source on GitHub ↗

Update the fake exported program to point to the real state dict. Modifies the fake exported program in-place.

(
    fake_exported_program: ExportedProgram, real_exported_program: ExportedProgram
)

Source from the content-addressed store, hash-verified

58
59
60def update_to_real_program(
61 fake_exported_program: ExportedProgram, real_exported_program: ExportedProgram
62) -> None:
63 """Update the fake exported program to point to the real state dict. Modifies the
64 fake exported program in-place.
65 """
66 for k, v in real_exported_program.state_dict.items():
67 fake_exported_program._state_dict[k] = v

Callers 2

_Function · 0.90
test_fake_programMethod · 0.90

Calls 1

itemsMethod · 0.80

Tested by 1

test_fake_programMethod · 0.72