f7b7edac5b9e329ffdda30d710f68db71d08e065,nni/common/graph_utils.py,TorchModuleGraph,_build_graph,#TorchModuleGraph#,624

Before Change


        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:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: Microsoft/nni
Commit Name: f7b7edac5b9e329ffdda30d710f68db71d08e065
Time: 2020-11-22
Author: 38930155+chicm-ms@users.noreply.github.com
File Name: nni/common/graph_utils.py
Class Name: TorchModuleGraph
Method Name: _build_graph


Project Name: pytorch/pytorch
Commit Name: 1c9347c6666d0bb8b9793b504e9cb597b75f1401
Time: 2021-01-27
Author: bowbao@microsoft.com
File Name: torch/onnx/utils.py
Class Name:
Method Name: _model_to_graph


Project Name: Microsoft/nni
Commit Name: 5d2a59fd4cf708d285d0db8ff3522c9156d2c4a9
Time: 2020-08-12
Author: 49771382+zheng-ningxin@users.noreply.github.com
File Name: src/sdk/pynni/nni/_graph_utils.py
Class Name: TorchModuleGraph
Method Name: unpack_manually