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

Method index_select

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

Source from the content-addressed store, hash-verified

2157 return dot_prod # can be negative
2158
2159 def index_select(self, dim: int, index: torch.Tensor) -> 'RGBDImage':
2160 rgbd_image = self.clone()
2161 for attr_name in ['rgb', 'depth', 'normal_w', 'hit_map', 'camera', 'feature']:
2162 arr = getattr(rgbd_image, attr_name, None)
2163 if arr is not None:
2164 setattr(rgbd_image, attr_name, arr.index_select(dim=dim, index=index))
2165 return rgbd_image
2166
2167 def chunk(self, chunks: int, dim: int = 0) -> T.List['RGBDImage']:
2168 out_dict = dict()

Callers

nothing calls this directly

Calls 2

cloneMethod · 0.95
index_selectMethod · 0.45

Tested by

no test coverage detected