MCPcopy Create free account
hub / github.com/Monalissaa/DisenDiff / forward

Method forward

src/iterative_embedding.py:32–50  ·  view source on GitHub ↗
(
        self,
        input_ids,
        timesteps,
    )

Source from the content-addressed store, hash-verified

30
31
32 def forward(
33 self,
34 input_ids,
35 timesteps,
36 ) -> torch.Tensor:
37 intput_shape = input_ids.size()
38
39 timesteps = timesteps.expand(intput_shape[0])
40 t_emb = self.time_proj(timesteps)
41
42
43 # emb = self.time_embedding(t_emb)[:, :, None]
44 emb = self.time_embedding(t_emb)
45 # emb = emb.repeat(intput_shape[1]).view(intput_shape[0], intput_shape[1], -1)
46 emb = emb.repeat(1, 77, 1).view(intput_shape[0], intput_shape[1], -1)
47 # print(offset_embedding.shape)
48 position_embedding = self.expand_embeddings(input_ids)
49 embedding = emb * position_embedding
50 return embedding

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected