MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / forward

Method forward

diffsynth/models/step1x_connector.py:229–243  ·  view source on GitHub ↗

Forward pass through the RMSNorm layer. Args: x (torch.Tensor): The input tensor. Returns: torch.Tensor: The output tensor after applying RMSNorm.

(self, x)

Source from the content-addressed store, hash-verified

227 return x * torch.rsqrt(x.pow(2).mean(-1, keepdim=True) + self.eps)
228
229 def forward(self, x):
230 """
231 Forward pass through the RMSNorm layer.
232
233 Args:
234 x (torch.Tensor): The input tensor.
235
236 Returns:
237 torch.Tensor: The output tensor after applying RMSNorm.
238
239 """
240 output = self._norm(x.float()).type_as(x)
241 if hasattr(self, "weight"):
242 output = output * self.weight
243 return output
244
245
246def get_norm_layer(norm_layer):

Callers

nothing calls this directly

Calls 1

_normMethod · 0.95

Tested by

no test coverage detected