(self, cfg: DictConfig)
| 254 | |
| 255 | class 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: |
nothing calls this directly
no test coverage detected