MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / forward

Method forward

StyleGAN/net/model.py:22–25  ·  view source on GitHub ↗
(self,x)

Source from the content-addressed store, hash-verified

20 super(PixelNorm, self).__init__()
21 self.epsilon = 1e-8
22 def forward(self,x):
23 #keepdim:输出张量是否保留了dim
24 out = x / torch.sqrt(torch.mean(x**2,dim = 1,keepdim=True) + self.epsilon)
25 return out
26
27#紧跟PixelNorm之后的3 x 3卷积
28class WSConv2d(torch.nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected