MCPcopy Create free account
hub / github.com/apple/ml-pointersect / remove_point_at_inf

Method remove_point_at_inf

pointersect/inference/structures.py:233–250  ·  view source on GitHub ↗

remove the point representing inf at n=0

(self)

Source from the content-addressed store, hash-verified

231 self.check_dim()
232
233 def remove_point_at_inf(self):
234 """
235 remove the point representing inf at n=0
236 """
237 if not self.included_point_at_inf:
238 return
239
240 b = self.xyz_w.size(0)
241 for name in self.attr_names:
242 arr = getattr(self, name, None)
243 if arr is None:
244 continue
245 arr_requires_grad = arr.requires_grad
246 arr = arr[:, 1:]
247 arr.requires_grad = arr_requires_grad
248 setattr(self, name, arr)
249 self.included_point_at_inf = False
250 self.check_dim()
251
252 def state_dict(self) -> T.Dict[str, T.Any]:
253 """Returns a dictionary that can be saved or load."""

Callers 1

silhouette_carvingMethod · 0.95

Calls 2

check_dimMethod · 0.95
sizeMethod · 0.80

Tested by

no test coverage detected