MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / forward

Method forward

src/diffusers/models/normalization.py:103–112  ·  view source on GitHub ↗
(
        self,
        timestep: torch.Tensor,
        added_cond_kwargs: Optional[Dict[str, torch.Tensor]] = None,
        batch_size: Optional[int] = None,
        hidden_dtype: Optional[torch.dtype] = None,
    )

Source from the content-addressed store, hash-verified

101 self.linear = nn.Linear(embedding_dim, 6 * embedding_dim, bias=True)
102
103 def forward(
104 self,
105 timestep: torch.Tensor,
106 added_cond_kwargs: Optional[Dict[str, torch.Tensor]] = None,
107 batch_size: Optional[int] = None,
108 hidden_dtype: Optional[torch.dtype] = None,
109 ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
110 # No modulation happening here.
111 embedded_timestep = self.emb(timestep, **added_cond_kwargs, batch_size=batch_size, hidden_dtype=hidden_dtype)
112 return self.linear(self.silu(embedded_timestep)), embedded_timestep
113
114
115class AdaGroupNorm(nn.Module):

Callers

nothing calls this directly

Calls 1

linearMethod · 0.80

Tested by

no test coverage detected