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

Method get_program

backends/test/program_builder.py:109–132  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

107 ]
108
109 def get_program(self) -> ExportedProgram:
110 gm = self.get_graph_module()
111 graph_signature = ExportGraphSignature(self.input_specs, self.output_specs)
112 in_spec = pytree.tree_flatten((tuple(graph_signature.user_inputs), {}))[1]
113 out_spec = pytree.tree_flatten(graph_signature.user_outputs)[1]
114 return ExportedProgram(
115 root=gm,
116 graph=gm.graph,
117 graph_signature=graph_signature,
118 # pyre-ignore[6]: Incompatible parameter type.
119 constants=self.constants,
120 state_dict=self.state_dict,
121 range_constraints={},
122 module_call_graph=[
123 ModuleCallEntry(
124 "",
125 ModuleCallSignature(
126 inputs=[], outputs=[], in_spec=in_spec, out_spec=out_spec
127 ),
128 )
129 ],
130 # pyre-ignore[6]: Incompatible parameter type.
131 verifiers=self.get_verifiers(),
132 )
133
134 def get_edge_program(self) -> EdgeProgramManager:
135 return EdgeProgramManager(

Calls 5

get_verifiersMethod · 0.95
ExportedProgramClass · 0.85
ModuleCallEntryClass · 0.85
ModuleCallSignatureClass · 0.85
get_graph_moduleMethod · 0.45