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

Method forward

point_e/models/transformer.py:195–203  ·  view source on GitHub ↗

:param x: an [N x C x T] tensor. :param t: an [N] tensor. :return: an [N x C' x T] tensor.

(self, x: torch.Tensor, t: torch.Tensor)

Source from the content-addressed store, hash-verified

193 self.output_proj.bias.zero_()
194
195 def forward(self, x: torch.Tensor, t: torch.Tensor):
196 """
197 :param x: an [N x C x T] tensor.
198 :param t: an [N] tensor.
199 :return: an [N x C' x T] tensor.
200 """
201 assert x.shape[-1] == self.n_ctx
202 t_embed = self.time_embed(timestep_embedding(t, self.backbone.width))
203 return self._forward_with_cond(x, [(t_embed, self.time_token_cond)])
204
205 def _forward_with_cond(
206 self, x: torch.Tensor, cond_as_token: List[Tuple[torch.Tensor, bool]]

Callers

nothing calls this directly

Calls 2

_forward_with_condMethod · 0.95
timestep_embeddingFunction · 0.85

Tested by

no test coverage detected