(ctx, x, weight, bias, eps)
| 210 | |
| 211 | @staticmethod |
| 212 | def forward(ctx, x, weight, bias, eps): |
| 213 | ctx.eps = eps |
| 214 | N, C, H, W = x.size() |
| 215 | mu = x.mean(1, keepdim=True) |
| 216 | var = (x - mu).pow(2).mean(1, keepdim=True) |
| 217 | y = (x - mu) / (var + eps).sqrt() |
| 218 | ctx.save_for_backward(y, var, weight) |
| 219 | y = weight.view(1, C, 1, 1) * y + bias.view(1, C, 1, 1) |
| 220 | return y |
| 221 | |
| 222 | @staticmethod |
| 223 | def backward(ctx, grad_output): |
nothing calls this directly
no outgoing calls
no test coverage detected