ea3df12ee5874a63875338289ce15ed94b103afd,pytorch/pytorchcv/models/hardnet.py,HarDStage,forward,#HarDStage#Any#,183
Before Change
def forward(self, x):
layers_ = [x]
for layer in range(len(self.layers)):
link = self.links[layer]
tin = []
for i in link:
tin.append(layers_[i])
if len(tin) > 1:
x = torch.cat(tin, 1)
else:
x = tin[0]
out = self.layers[layer](x)
layers_.append(out)
t = len(layers_)
out_ = []
for i in range(t):
if (i == 0 and self.keepBase) or (i == t - 1) or (i % 2 == 1):
After Change
def forward(self, x):
layer_outs = [x]
for links_i, layer_i in zip(self.links_list, self.blocks._modules.values()):
layer_in = []
for idx_ij in links_i:
layer_in.append(layer_outs[idx_ij])
if len(layer_in) > 1:
x = torch.cat(layer_in, dim=1)
else:
x = layer_in[0]
out = layer_i(x)
layer_outs.append(out)
outs = []
for i, layer_out_i in enumerate(layer_outs):
if (i == len(layer_outs) - 1) or (i % 2 == 1):
outs.append(layer_out_i)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: osmr/imgclsmob
Commit Name: ea3df12ee5874a63875338289ce15ed94b103afd
Time: 2020-01-17
Author: osemery@gmail.com
File Name: pytorch/pytorchcv/models/hardnet.py
Class Name: HarDStage
Method Name: forward
Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: eb5be3e83d2efe3ce1037a4e48c596d4e98ec4c0
Time: 2021-01-18
Author: skktexas@gmail.com
File Name: perfkitbenchmarker/providers/ibmcloud/ibmcloud_network.py
Class Name:
Method Name: GetSubnetIndex
Project Name: suavecode/SUAVE
Commit Name: 843753bc258e3054da0bf662576010163399d368
Time: 2014-04-04
Author: aerialhedgehog@gmail.com
File Name: trunk/SUAVE/Methods/Performance/evaluate_mission.py
Class Name:
Method Name: evaluate_mission