MCPcopy Create free account
hub / github.com/huggingface/diffusers / __init__

Method __init__

src/diffusers/models/normalization.py:105–113  ·  view source on GitHub ↗
(self, embedding_dim: int, norm_type: str = "layer_norm", bias: bool = True)

Source from the content-addressed store, hash-verified

103 """
104
105 def __init__(self, embedding_dim: int, norm_type: str = "layer_norm", bias: bool = True) -> None:
106 super().__init__()
107
108 self.silu = nn.SiLU()
109 self.linear = nn.Linear(embedding_dim, 9 * embedding_dim, bias=bias)
110 if norm_type == "layer_norm":
111 self.norm = nn.LayerNorm(embedding_dim, elementwise_affine=False, eps=1e-6)
112 else:
113 raise ValueError(f"Unsupported `norm_type` ({norm_type}) provided. Supported ones are: 'layer_norm'.")
114
115 def forward(
116 self,

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected