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

Method forward

point_e/models/sdf.py:37–58  ·  view source on GitHub ↗

Predict the SDF at the coordinates x, given a batch of point clouds. Either point_clouds or encoded should be passed. Only exactly one of these arguments should be None. :param x: a [batch x 3 x N'] tensor of query points. :param point_clouds: a [batch x 3

(
        self,
        x: torch.Tensor,
        point_clouds: Optional[torch.Tensor] = None,
        encoded: Optional[Dict[str, torch.Tensor]] = None,
    )

Source from the content-addressed store, hash-verified

35 """
36
37 def forward(
38 self,
39 x: torch.Tensor,
40 point_clouds: Optional[torch.Tensor] = None,
41 encoded: Optional[Dict[str, torch.Tensor]] = None,
42 ) -> torch.Tensor:
43 """
44 Predict the SDF at the coordinates x, given a batch of point clouds.
45
46 Either point_clouds or encoded should be passed. Only exactly one of
47 these arguments should be None.
48
49 :param x: a [batch x 3 x N'] tensor of query points.
50 :param point_clouds: a [batch x 3 x N] batch of point clouds.
51 :param encoded: the result of calling encode_point_clouds().
52 :return: a [batch x N'] tensor of SDF predictions.
53 """
54 assert point_clouds is not None or encoded is not None
55 assert point_clouds is None or encoded is None
56 if point_clouds is not None:
57 encoded = self.encode_point_clouds(point_clouds)
58 return self.predict_sdf(x, encoded)
59
60 @abstractmethod
61 def predict_sdf(

Callers

nothing calls this directly

Calls 2

encode_point_cloudsMethod · 0.95
predict_sdfMethod · 0.95

Tested by

no test coverage detected