MCPcopy Create free account
hub / github.com/pytorch/pytorch / inline_graph

Function inline_graph

torch/contrib/_tensorboard_vis.py:98–106  ·  view source on GitHub ↗
(subgraph, name, node)

Source from the content-addressed store, hash-verified

96def visualize_rec(graph, value_map, name_prefix, pb_graph, executors_it=None):
97 """Recursive part of visualize (basically skips setting up the input and output nodes)."""
98 def inline_graph(subgraph, name, node):
99 rec_value_map = {inp.unique(): value_map[val.unique()]
100 for inp, val in zip(subgraph.inputs(), node.inputs())}
101 visualize_rec(graph=subgraph,
102 value_map=rec_value_map,
103 name_prefix=name,
104 pb_graph=pb_graph)
105 for out, val in zip(subgraph.outputs(), node.outputs()):
106 value_map[val.unique()] = rec_value_map[out.unique()]
107
108 op_id_counter: DefaultDict[str, int] = defaultdict(int)
109

Callers 2

visualize_graph_executorFunction · 0.85
add_fusion_groupFunction · 0.85

Calls 4

visualize_recFunction · 0.85
uniqueMethod · 0.80
inputsMethod · 0.45
outputsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…