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

Method forward

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

Source from the content-addressed store, hash-verified

133 self.normalized_shape = (normalized_shape, )
134
135 def forward(self, x):
136 if self.data_format == "channels_last":
137 return F.layer_norm(x, self.normalized_shape, self.weight, self.bias, self.eps)
138 elif self.data_format == "channels_first":
139 u = x.mean(1, keepdim=True)
140 s = (x - u).pow(2).mean(1, keepdim=True)
141 x = (x - u) / torch.sqrt(s + self.eps)
142 x = self.weight[:, None, None] * x + self.bias[:, None, None]
143 return x
144
145
146model_urls = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected