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

Function gather_points_v2

pointersect/pr/cuda/pr_cuda.cpp:257–271  ·  view source on GitHub ↗

Gather the points belonging to each grid cell. Args: grid_idxs: (b, n), grid linear index of each point total_cells: (b,) total grid cells valid_mask: (b, n), whether to record the point cell_counts: (b, max_num_cells), number of points in a cell Returns: membank: (b, n), should use the pidx of cell_idx is from cell_start_idx[b][cell_idx] to cell_counts[b][cell_idx+1] (excluded). cell_start_idx:

Source from the content-addressed store, hash-verified

255// (b, n_cells+1),
256//
257std::tuple<torch::Tensor, torch::Tensor> gather_points_v2(
258 const torch::Tensor & grid_idxs, // (b, n), long
259 const torch::Tensor & total_cells, // (b,) int64_t
260 const torch::Tensor & valid_mask, // (b, n), bool
261 const torch::Tensor & cell_counts // (b, n_cells), int32
262) {
263
264 CHECK_INPUT(grid_idxs);
265 CHECK_INPUT(total_cells);
266 CHECK_INPUT(valid_mask);
267 CHECK_INPUT(cell_counts);
268
269
270 return gather_points_cuda_v2(grid_idxs, total_cells, valid_mask, cell_counts);
271}
272
273
274

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected