MCPcopy Create free account
hub / github.com/TimSeizinger/Bokehlicious / forward

Method forward

method/nn_util.py:212–220  ·  view source on GitHub ↗
(ctx, x, weight, bias, eps)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected