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

Function get_norm_layer

diffsynth/models/step1x_connector.py:246–261  ·  view source on GitHub ↗

Get the normalization layer. Args: norm_layer (str): The type of normalization layer. Returns: norm_layer (nn.Module): The normalization layer.

(norm_layer)

Source from the content-addressed store, hash-verified

244
245
246def get_norm_layer(norm_layer):
247 """
248 Get the normalization layer.
249
250 Args:
251 norm_layer (str): The type of normalization layer.
252
253 Returns:
254 norm_layer (nn.Module): The normalization layer.
255 """
256 if norm_layer == "layer":
257 return nn.LayerNorm
258 elif norm_layer == "rms":
259 return RMSNorm
260 else:
261 raise NotImplementedError(f"Norm layer {norm_layer} is not implemented")
262
263
264def get_activation_layer(act_type):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected