(
self,
input_ids,
timesteps,
)
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected