89f41f9280daceb58895f6a958c493f126db03bc,batchflow/models/eager_torch/layers/resize.py,Combine,__init__,#Combine#Any#Any#Any#,284

Before Change


        self.force_resize = force_resize
        self.op = op
        if op in self.OPS and self.OPS[op].__name__ == "softsum":
            args = dict(layout="c", filters=get_shape(inputs[0])[1],
                        kernel_size=1)
            conv = [ConvBlock(inputs=tensor, **args) for tensor in inputs]
            self.conv = nn.ModuleList(conv)
            self.op = lambda inputs: self.OPS[op](self, inputs)

After Change


        self.force_resize = force_resize
        self.name = op

        if op in self.OPS:
            op = self.OPS[op]
            if op.__name__ == "softsum":
                self.op = lambda inputs: op(inputs, **kwargs)
            else:
                self.op = op
        elif callable(op):
            self.op = op
        else:
            raise ValueError("Combine operation must be a callable or \
                              one from {}, instead got {}.".format(list(self.OPS.keys()), op))

    def forward(self, inputs):
        if self.force_resize:
            inputs = self.spatial_resize(inputs)
        return self.op(inputs)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: analysiscenter/batchflow
Commit Name: 89f41f9280daceb58895f6a958c493f126db03bc
Time: 2019-12-05
Author: Tsimfer.SA@gazprom-neft.ru
File Name: batchflow/models/eager_torch/layers/resize.py
Class Name: Combine
Method Name: __init__


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 3792a7384c9113515c70f0fac455ab938db1f2c0
Time: 2015-01-26
Author: connormccoy@google.com
File Name: perfkitbenchmarker/publisher.py
Class Name: SampleCollector
Method Name: AddSamples


Project Name: MolSSI/QCEngine
Commit Name: e7202d5b855714c2ef2b45c74b7258e7c7ac233e
Time: 2019-03-07
Author: malorian@me.com
File Name: qcengine/compute.py
Class Name:
Method Name: compute