(self, x)
| 102 | self.drop_path = DropPath(drop_path) if drop_path > 0.0 else nn.Identity() |
| 103 | |
| 104 | def forward(self, x): |
| 105 | input = x |
| 106 | x = self.dwconv(x) |
| 107 | x = self.norm(x) |
| 108 | x = x.permute(0, 2, 3, 1) # (N, C, H, W) -> (N, H, W, C) |
| 109 | x = self.pwconv1(x) |
| 110 | x = self.act(x) |
| 111 | x = self.pwconv2(x) |
| 112 | if self.gamma is not None: |
| 113 | x = self.gamma * x |
| 114 | x = x.permute(0, 3, 1, 2) # (N, H, W, C) -> (N, C, H, W) |
| 115 | |
| 116 | x = input + self.drop_path(x) |
| 117 | return x |
| 118 | |
| 119 | |
| 120 | class Fuser(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected