MCPcopy Create free account
hub / github.com/Gadersd/stable-diffusion-burn / timestep_embedding

Function timestep_embedding

python/dump.py:274–278  ·  view source on GitHub ↗
(timesteps, dim, max_period=10000)

Source from the content-addressed store, hash-verified

272 return self.conv(x)
273
274def timestep_embedding(timesteps, dim, max_period=10000):
275 half = dim // 2
276 freqs = (-math.log(max_period) * Tensor.arange(half) / half).exp()
277 args = timesteps * freqs
278 return Tensor.cat(args.cos(), args.sin()).reshape(1, -1)
279
280class UNetModel:
281 def __init__(self):

Callers 1

__call__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected