(model: torch.nn.Module, inputs: Any, output_path=None)
| 30 | |
| 31 | |
| 32 | def gen_etrecord(model: torch.nn.Module, inputs: Any, output_path=None): |
| 33 | f = model |
| 34 | aten_dialect: ExportedProgram = export(f, inputs, strict=True) |
| 35 | edge_program: EdgeProgramManager = to_edge( |
| 36 | aten_dialect, compile_config=EdgeCompileConfig(_check_ir_validity=True) |
| 37 | ) |
| 38 | edge_program_copy = copy.deepcopy(edge_program) |
| 39 | et_program: ExecutorchProgramManager = edge_program_copy.to_executorch() |
| 40 | generate_etrecord( |
| 41 | (DEFAULT_OUTPUT_PATH if not output_path else output_path), |
| 42 | edge_dialect_program=edge_program, |
| 43 | executorch_program=et_program, |
| 44 | extra_recorded_export_modules={ |
| 45 | "aten_dialect_output": aten_dialect, |
| 46 | }, |
| 47 | ) |
| 48 | |
| 49 | |
| 50 | def main() -> None: |
no test coverage detected