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)
In pattern: SUPERPATTERN
Frequency: 3
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: jhfjhfj1/autokeras
Commit Name: 32ecda6b38cee2721195d4f5cb1da5609d2fd264
Time: 2019-07-26
Author: jhfjhfj1@gmail.com
File Name: autokeras/meta_model.py
Class Name: TextAssembler
Method Name: assemble