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

Function debug_tosa_dump

backends/arm/common/debug.py:55–66  ·  view source on GitHub ↗
(tosa_graph: bytes, path: str, suffix: str = "")

Source from the content-addressed store, hash-verified

53
54# Output TOSA flatbuffer for debugging
55def 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
69def debug_fail(

Callers 2

_preprocessMethod · 0.90
debug_failFunction · 0.85

Calls 2

infoMethod · 0.80
writeMethod · 0.80

Tested by

no test coverage detected