The outputs of program emission. Contains the executorch program object as well as a mapping of instruction ids to debug handles.
| 26 | |
| 27 | @dataclass |
| 28 | class EmitterOutput: |
| 29 | """ |
| 30 | The outputs of program emission. Contains the executorch program object as well as |
| 31 | a mapping of instruction ids to debug handles. |
| 32 | """ |
| 33 | |
| 34 | # The ExecuTorch program |
| 35 | program: Program |
| 36 | |
| 37 | # This dictionary maps the instruction ids to their corresponding |
| 38 | # debug handles or list of debug handles in the case of delegate calls. |
| 39 | debug_handle_map: Dict[int, Union[int, List[int]]] |
| 40 | |
| 41 | # This dictionary maps the method name to the corresponding dict which |
| 42 | # contains the mapping of the delegate instruction id to its corresponding |
| 43 | # delegate name and delegate debug identifier mapping. |
| 44 | method_to_delegate_debug_id_map: Dict[ |
| 45 | str, Dict[int, Dict[str, Union[str, _DelegateDebugIdentifierMap]]] |
| 46 | ] |
| 47 | |
| 48 | # This dictionary maps the method name to the corresponding dict which |
| 49 | # contains the mapping of the instruction ids to the number of outputs |
| 50 | # generated by each instruction. |
| 51 | instruction_id_to_num_outs_map: Dict[str, Dict[int, int]] |
| 52 | |
| 53 | mutable_data: Optional[List[Buffer]] |
| 54 | |
| 55 | # Constants are optionally stored in external files. |
| 56 | # Aggregate unique external constants into one buffer. |
| 57 | external_constant_buffer: List[bytes] |
| 58 | # Each constant_tag groups a set of constants together. |
| 59 | # {constant_tag: {fqn: index into external_constant_buffer}} |
| 60 | external_constant_map: Optional[Dict[str, Dict[str, int]]] |
| 61 | |
| 62 | |
| 63 | def _remove_non_user_outputs(exported_program: ExportedProgram) -> torch.fx.GraphModule: |
no outgoing calls