(self, num_features)
| 70 | # This is designed to insert BNStat layer between Conv2d(without bias) and its bias |
| 71 | class BiasAdd(nn.Module): |
| 72 | def __init__(self, num_features): |
| 73 | super(BiasAdd, self).__init__() |
| 74 | self.bias = torch.nn.Parameter(torch.Tensor(num_features)) |
| 75 | def forward(self, x): |
| 76 | return x + self.bias.view(1, -1, 1, 1) |
| 77 |