def add_edges(digraph, node_inpt_table, node_inpt_shape_table):
"""
Add TensorFlow graph's edges to graphviz.dot.Digraph.
@param dirgraph
@param node_inpt_table
@param node_inpt_shape_table
@return graphviz.dot.Digraph
"""
for node, node_inputs in node_inpt_table.items():
if re.match(r"\^", node): continue
for ni in node_inputs:
if ni == node: continue
if re.match(r"\^", ni): continue
if not ni in node_inpt_shape_table:
digraph.edge(ni, node)
else:
shape = node_inpt_shape_table[ni]
digraph.edge(ni, node, label=edge_label(shape))
return digraph
评论列表
文章目录