MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / TimestepEmbedding_

Class TimestepEmbedding_

diffusers/scripts/convert_consistency_decoder.py:213–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211
212
213class TimestepEmbedding_(nn.Module):
214 def __init__(self, n_time=1024, n_emb=320, n_out=1280) -> None:
215 super().__init__()
216 self.emb = nn.Embedding(n_time, n_emb)
217 self.f_1 = nn.Linear(n_emb, n_out)
218 self.f_2 = nn.Linear(n_out, n_out)
219
220 def forward(self, x) -> torch.Tensor:
221 x = self.emb(x)
222 x = self.f_1(x)
223 x = F.silu(x)
224 return self.f_2(x)
225
226
227class ImageEmbedding(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected