res = out
else:
conv_x = out
skip_x = self.shortcut(x)
res = skip_x + conv_x
return res
After Change
if torch.sum(torch.abs(out)).item() == 0 and x.size() == out.size():
// is zero layer
return x
if self.shortcut is None:
return out
return out + self.shortcut(x)
class ShuffleLayer(nn.Module):
def __init__(self, groups):