MCPcopy Create free account
hub / github.com/VisionRush/DeepFakeDefenders / forward

Method forward

model/convnext.py:37–50  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

35 self.drop_path = DropPath(drop_path) if drop_path > 0. else nn.Identity()
36
37 def forward(self, x):
38 input = x
39 x = self.dwconv(x)
40 x = x.permute(0, 2, 3, 1) # (N, C, H, W) -> (N, H, W, C)
41 x = self.norm(x)
42 x = self.pwconv1(x)
43 x = self.act(x)
44 x = self.pwconv2(x)
45 if self.gamma is not None:
46 x = self.gamma * x
47 x = x.permute(0, 3, 1, 2) # (N, H, W, C) -> (N, C, H, W)
48
49 x = input + self.drop_path(x)
50 return x
51
52class ConvNeXt(nn.Module):
53 r""" ConvNeXt

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected