| 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( |