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

Function draw_graph

backends/qualcomm/utils/utils.py:961–973  ·  view source on GitHub ↗
(title, path, graph_module: torch.fx.GraphModule, format=DrawFormat.SVG)

Source from the content-addressed store, hash-verified

959
960
961def draw_graph(title, path, graph_module: torch.fx.GraphModule, format=DrawFormat.SVG):
962 graph = passes.graph_drawer.FxGraphDrawer(graph_module, title)
963 warnings.warn(
964 "For large models such as LLM, it is strongly recommended to use PYDOT format.",
965 stacklevel=1,
966 )
967 if format == DrawFormat.SVG:
968 with open(f"{path}/{title}.svg", "wb") as f:
969 f.write(graph.get_dot_graph().create_svg())
970 elif format == DrawFormat.PYDOT:
971 graph.get_dot_graph().write_raw(f"{path}/{title}.dot")
972 else:
973 raise RuntimeError(f"Unknown format {format}.")
974
975
976def generate_gpu_compiler_spec(

Callers 2

compileFunction · 0.90
compileFunction · 0.90

Calls 2

writeMethod · 0.80
get_dot_graphMethod · 0.80

Tested by

no test coverage detected