MCPcopy Create free account
hub / github.com/AlmondGod/tinyworlds / forward

Method forward

models/video_tokenizer.py:64–76  ·  view source on GitHub ↗
(self, latents)

Source from the content-addressed store, hash-verified

62 self.register_buffer("pos_spatial_dec", pe_spatial_dec, persistent=False)
63
64 def forward(self, latents):
65 # latents: [B, T, P, L]
66 # embed latents and add spatial PE
67 embedding = self.latent_embed(latents) # [B, T, P, E]
68 embedding = embedding + self.pos_spatial_dec.to(dtype=embedding.dtype, device=embedding.device)
69
70 # apply transformer (temporal PE added inside)
71 embedding = self.transformer(embedding) # [B, T, P, E]
72
73 # reconstruct frames using patch-wise head
74 frames_out = self.frame_head(embedding) # [B, T, C, H, W]
75
76 return frames_out
77
78
79class VideoTokenizer(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected