MCPcopy Create free account
hub / github.com/openai/point-e / forward

Method forward

point_e/models/transformer.py:391–402  ·  view source on GitHub ↗

: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)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 3

_embed_low_resMethod · 0.95
timestep_embeddingFunction · 0.85
_forward_with_condMethod · 0.80

Tested by

no test coverage detected