MCPcopy Create free account
hub / github.com/Vchitect/Latte / __init__

Method __init__

tools/utils/layers.py:256–266  ·  view source on GitHub ↗
(self, cfg: DictConfig)

Source from the content-addressed store, hash-verified

254
255class TemporalDifferenceEncoder(nn.Module):
256 def __init__(self, cfg: DictConfig):
257 super().__init__()
258
259 self.cfg = cfg
260
261 if self.cfg.sampling.num_frames_per_video > 1:
262 self.d = 256
263 self.const_embed = nn.Embedding(self.cfg.sampling.max_num_frames, self.d)
264 self.time_encoder = FixedTimeEncoder(
265 self.cfg.sampling.max_num_frames,
266 skip_small_t_freqs=self.cfg.get('skip_small_t_freqs', 0))
267
268 def get_dim(self) -> int:
269 if self.cfg.sampling.num_frames_per_video == 1:

Callers

nothing calls this directly

Calls 2

FixedTimeEncoderClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected