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: 7

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: bokeh/bokeh
Commit Name: 5f6b5d3851d0b719f401eafbfc569420405d1ef3
Time: 2016-08-16
Author: canavandl@gmail.com
File Name: bokeh/models/formatters.py
Class Name: FuncTickFormatter
Method Name: from_py_func


Project Name: tensorflow/datasets
Commit Name: c4f3799d5713d467ca577a6d0593f242076c9540
Time: 2018-11-14
Author: epot@google.com
File Name: tensorflow_datasets/core/test_utils.py
Class Name: FeatureExpectationsTestCase
Method Name: test_encode_decode