(self,x)
| 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卷积 |
| 28 | class WSConv2d(torch.nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected