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

Method reset_point_at_inf

pointersect/inference/structures.py:209–231  ·  view source on GitHub ↗

reset the point representing inf at n=0

(self)

Source from the content-addressed store, hash-verified

207 self.check_dim()
208
209 def reset_point_at_inf(self):
210 """
211 reset the point representing inf at n=0
212 """
213 if not self.included_point_at_inf:
214 return
215
216 with torch.no_grad():
217 for name in self.attr_names:
218 arr = getattr(self, name, None)
219 if arr is None:
220 continue
221
222 if name == 'xyz_w':
223 val = INF
224 elif name == 'valid_mask':
225 val = 0
226 else:
227 val = 0
228
229 arr[:, 0, :] = val
230 setattr(self, name, arr)
231 self.check_dim()
232
233 def remove_point_at_inf(self):
234 """

Callers

nothing calls this directly

Calls 1

check_dimMethod · 0.95

Tested by

no test coverage detected