(tosa_graph: bytes, path: str, suffix: str = "")
| 53 | |
| 54 | # Output TOSA flatbuffer for debugging |
| 55 | def debug_tosa_dump(tosa_graph: bytes, path: str, suffix: str = ""): |
| 56 | filename = f"output{suffix}.tosa" |
| 57 | |
| 58 | logger.info(f"Emitting debug output to: {path=}, {suffix=}") |
| 59 | |
| 60 | os.makedirs(path, exist_ok=True) |
| 61 | |
| 62 | filepath_tosa_fb = os.path.join(path, filename) |
| 63 | with open(filepath_tosa_fb, "wb") as f: |
| 64 | f.write(tosa_graph) |
| 65 | if not os.path.exists(filepath_tosa_fb): |
| 66 | raise IOError("Failed to write TOSA flatbuffer") |
| 67 | |
| 68 | |
| 69 | def debug_fail( |
no test coverage detected