(self, num_features, dim)
| 143 | |
| 144 | class VNBatchNorm(nn.Module): |
| 145 | def __init__(self, num_features, dim): |
| 146 | super(VNBatchNorm, self).__init__() |
| 147 | self.dim = dim |
| 148 | if dim == 3 or dim == 4: |
| 149 | self.bn = nn.BatchNorm1d(num_features) |
| 150 | elif dim == 5: |
| 151 | self.bn = nn.BatchNorm2d(num_features) |
| 152 | |
| 153 | def forward(self, x): |
| 154 | ''' |