(self, x)
| 95 | self.bias = nn.Parameter(torch.zeros(num_channels)) |
| 96 | |
| 97 | def forward(self, x): |
| 98 | N, C, H, W = x.shape |
| 99 | x = x.reshape(N, self.num_groups, C // self.num_groups, H, W) |
| 100 | mean = x.mean([2, 3, 4], keepdim=True) |
| 101 | var = x.var([2, 3, 4], keepdim=True) |
| 102 | x = (x - mean) / torch.sqrt(var + self.eps) |
| 103 | x = x.reshape(N, C, H, W) |
| 104 | return x * self.weight[None, :, None, None] + self.bias[None, :, None, None] |
| 105 | |
| 106 | class DropPath(nn.Module): |
| 107 | def __init__(self, drop_prob=0.0): |
nothing calls this directly
no outgoing calls
no test coverage detected