1b8ad820a31941b5d847fa3c5cab358b26d44fcf,coremltools/models/neural_network/builder.py,NeuralNetworkBuilder,add_elementwise,#NeuralNetworkBuilder#Any#Any#Any#Any#Any#,1350

Before Change


        spec_layer = self._add_generic_layer(name, input_names, [output_name])

        // add one of the following layers
        if mode.upper() == "CONCAT":
            spec_layer.concat.sequenceConcat = False
        elif mode.upper() == "SEQUENCE_CONCAT":
            spec_layer.concat.sequenceConcat = True
        elif mode.upper() == "ADD":
            spec_layer.add.MergeFromString(b"")
            if alpha:
                spec_layer.add.alpha = alpha
        elif mode.upper() == "MULTIPLY":
            spec_layer.multiply.MergeFromString(b"")
            if alpha:
                spec_layer.multiply.alpha = alpha
        elif mode.upper() == "COS":
            spec_layer.dot.cosineSimilarity = True
        elif mode.upper() == "DOT":
            spec_layer.dot.cosineSimilarity = False
        elif mode.upper() == "MAX":
            spec_layer.max.MergeFromString(b"")
        elif mode.upper() == "MIN":
            spec_layer.min.MergeFromString(b"")
        elif mode.upper() == "AVE":
            spec_layer.average.MergeFromString(b"")
        else:
            raise ValueError("Unsupported elementwise mode %s" % mode)

After Change


        spec_layer = self._add_generic_layer(name, input_names, [output_name])

        // add one of the following layers
        mode = mode.upper() if isinstance(mode, str) else mode
        if mode == "CONCAT":
            spec_layer.concat.sequenceConcat = False
        elif mode == "SEQUENCE_CONCAT":
            spec_layer.concat.sequenceConcat = True
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 10

Instances


Project Name: apple/coremltools
Commit Name: 1b8ad820a31941b5d847fa3c5cab358b26d44fcf
Time: 2019-10-09
Author: yuduo@apple.com
File Name: coremltools/models/neural_network/builder.py
Class Name: NeuralNetworkBuilder
Method Name: add_elementwise


Project Name: apple/coremltools
Commit Name: 1b8ad820a31941b5d847fa3c5cab358b26d44fcf
Time: 2019-10-09
Author: yuduo@apple.com
File Name: coremltools/models/neural_network/builder.py
Class Name: NeuralNetworkBuilder
Method Name: add_scatter


Project Name: apple/coremltools
Commit Name: 1b8ad820a31941b5d847fa3c5cab358b26d44fcf
Time: 2019-10-09
Author: yuduo@apple.com
File Name: coremltools/models/neural_network/builder.py
Class Name: NeuralNetworkBuilder
Method Name: add_scatter_along_axis


Project Name: apple/coremltools
Commit Name: 1b8ad820a31941b5d847fa3c5cab358b26d44fcf
Time: 2019-10-09
Author: yuduo@apple.com
File Name: coremltools/models/neural_network/builder.py
Class Name: NeuralNetworkBuilder
Method Name: add_elementwise


Project Name: apple/coremltools
Commit Name: 1b8ad820a31941b5d847fa3c5cab358b26d44fcf
Time: 2019-10-09
Author: yuduo@apple.com
File Name: coremltools/models/neural_network/builder.py
Class Name: NeuralNetworkBuilder
Method Name: add_scatter_nd