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

Before Change


        _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()}

After Change


            if node.kind() == CONSTANT_KIND:
                continue
            for x in node.outputs():
                if x.node().kind() == CONSTANT_KIND:
                    continue
                output_to_node[x.debugName()].append(node)
                assert len(output_to_node[x.debugName()]) <= 1, "One output cannot be generated by multiple nodes %s" % x.debugName()
            for x in node.inputs():
                if x.node().kind() == CONSTANT_KIND:
                    continue
                input_to_node[x.debugName()].append(node)
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: 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


Project Name: lanpa/tensorboardX
Commit Name: 23de6f0cd811b9a4e9b3f7db3723f609dea13ced
Time: 2019-09-23
Author: huang.dexter@gmail.com
File Name: tensorboardX/pytorch_graph.py
Class Name:
Method Name: parse