:param x: an [N x C1 x T] tensor. :param t: an [N] tensor. :param low_res: an [N x C2 x T'] tensor of conditioning points. :return: an [N x C3 x T] tensor.
(self, x: torch.Tensor, t: torch.Tensor, *, low_res: torch.Tensor)
| 389 | ) |
| 390 | |
| 391 | def forward(self, x: torch.Tensor, t: torch.Tensor, *, low_res: torch.Tensor): |
| 392 | """ |
| 393 | :param x: an [N x C1 x T] tensor. |
| 394 | :param t: an [N] tensor. |
| 395 | :param low_res: an [N x C2 x T'] tensor of conditioning points. |
| 396 | :return: an [N x C3 x T] tensor. |
| 397 | """ |
| 398 | assert x.shape[-1] == self.n_ctx |
| 399 | t_embed = self.time_embed(timestep_embedding(t, self.backbone.width)) |
| 400 | low_res_embed = self._embed_low_res(low_res) |
| 401 | cond = [(t_embed, self.time_token_cond), (low_res_embed, True)] |
| 402 | return self._forward_with_cond(x, cond) |
| 403 | |
| 404 | def _embed_low_res(self, x: torch.Tensor) -> torch.Tensor: |
| 405 | if self.channel_scales is not None: |
nothing calls this directly
no test coverage detected