MCPcopy Index your code
hub / github.com/huggingface/diffusers / LpNorm

Class LpNorm

src/diffusers/models/normalization.py:620–629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618
619
620class LpNorm(nn.Module):
621 def __init__(self, p: int = 2, dim: int = -1, eps: float = 1e-12):
622 super().__init__()
623
624 self.p = p
625 self.dim = dim
626 self.eps = eps
627
628 def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
629 return F.normalize(hidden_states, p=self.p, dim=self.dim, eps=self.eps)
630
631
632def get_normalization(

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…