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

Class Timesteps

diffusers/src/diffusers/models/embeddings.py:765–781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

763
764
765class Timesteps(nn.Module):
766 def __init__(self, num_channels: int, flip_sin_to_cos: bool, downscale_freq_shift: float, scale: int = 1):
767 super().__init__()
768 self.num_channels = num_channels
769 self.flip_sin_to_cos = flip_sin_to_cos
770 self.downscale_freq_shift = downscale_freq_shift
771 self.scale = scale
772
773 def forward(self, timesteps):
774 t_emb = get_timestep_embedding(
775 timesteps,
776 self.num_channels,
777 flip_sin_to_cos=self.flip_sin_to_cos,
778 downscale_freq_shift=self.downscale_freq_shift,
779 scale=self.scale,
780 )
781 return t_emb
782
783
784class GaussianFourierProjection(nn.Module):

Callers 15

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected