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

Method index_select

pointersect/inference/structures.py:1614–1620  ·  view source on GitHub ↗
(self, dim: int, index: torch.Tensor)

Source from the content-addressed store, hash-verified

1612 self.attr_names = ['H_c2w', 'intrinsic', 'width_px', 'height_px']
1613
1614 def index_select(self, dim: int, index: torch.Tensor) -> 'Camera':
1615 camera = self.clone()
1616 for attr_name in ['H_c2w', 'intrinsic']:
1617 arr = getattr(camera, attr_name, None)
1618 if arr is not None:
1619 setattr(camera, attr_name, torch.index_select(arr, dim=dim, index=index))
1620 return camera
1621
1622 def chunk(self, chunks: int, dim: int = 0) -> T.List['Camera']:
1623 out_dict = dict()

Callers 3

render_hypersimFunction · 0.45
render_point_cloudFunction · 0.45
index_selectMethod · 0.45

Calls 1

cloneMethod · 0.95

Tested by

no test coverage detected