graph = self.trace.graph
_logger.debug(graph)
// build output mapping, from output debugName to its node
output_to_node = {x.debugName(): n for n in graph.nodes()
for x in n.outputs()}
// build input mapping, from input debugName to its node
input_to_node = {x.debugName(): n for n in graph.nodes()
for x in n.inputs()}
// build module mapping, from module name to all nodes (as list) under this module scope
After Change
// associate module name with their trace graph nodes
for node in graph.nodes():
if node.kind() == CONSTANT_KIND:
continue
module_name = self._get_module_name(node.scopeName())
if module_name in self.leaf_modules:
module_to_nodes[module_name].append(node)
else: