(self, x)
| 81 | self.bias = nn.Parameter(torch.zeros(normalized_shape)) |
| 82 | |
| 83 | def forward(self, x): |
| 84 | mean = x.mean(-1, keepdim=True) |
| 85 | std = x.std(-1, keepdim=True) |
| 86 | return self.weight * (x - mean) / (std + self.eps) + self.bias |
| 87 | |
| 88 | class GroupNorm(nn.Module): |
| 89 | def __init__(self, num_groups, num_channels, eps=1e-5): |
nothing calls this directly
no outgoing calls
no test coverage detected