def tf_to_dot(g): dot = Digraph() for n in g.node: dot.node(n.name, label=n.name) for i in n.input: dot.edge(i, n.name) return dot