onnx.helper

Graphs

onnx.tools.net_drawer.GetPydotGraph(graph: onnx.onnx_ml_pb2.GraphProto, name: Optional[str] = None, rankdir: str = 'LR', node_producer: Optional[Callable[[onnx.onnx_ml_pb2.NodeProto, int], pydot.Node]] = None, embed_docstring: bool = False) pydot.Dot[source]
onnx.tools.net_drawer.GetOpNodeProducer(embed_docstring: bool = False, **kwargs: Any) Callable[[onnx.onnx_ml_pb2.NodeProto, int], pydot.Node][source]
from onnx.tools.net_drawer import GetPydotGraph, GetOpNodeProducer

pydot_graph = GetPydotGraph(
    model_onnx.graph,  # model_onnx is a ModelProto instance
    name=model_onnx.graph.name,
    rankdir="TP",
    node_producer=GetOpNodeProducer("docstring"))
pydot_graph.write_dot("graph.dot")