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)


    def spatial_resize(self, inputs):
         Force the same shapes of the inputs, if needed. 
        shape_ = get_shape(inputs[0])
        dim_ = get_num_dims(inputs[0])

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

Non-data size: 8

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: NervanaSystems/coach
Commit Name: 524f8436a298a243bd81b8860f85ab6145b4b26f
Time: 2018-11-14
Author: scott.leishman@gmail.com
File Name: rl_coach/environments/doom_environment.py
Class Name: DoomEnvironment
Method Name: __init__


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 5dd65b017cf87fa4d88c5123d4b3385d4591a2a0
Time: 2019-03-13
Author: namedhard@zeroun.net
File Name: QUANTAXIS/QAMarket/QATTSBroker.py
Class Name: QA_TTSBroker
Method Name: data_to_df


Project Name: Microsoft/nni
Commit Name: 41e587038a32db002178329a64224ea6a5b2a5f9
Time: 2019-09-15
Author: 40699903+liuzhe-lz@users.noreply.github.com
File Name: src/sdk/pynni/nni/msg_dispatcher.py
Class Name: MsgDispatcher
Method Name: _handle_final_metric_data