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

Function gather_points_v1

pointersect/pr/cuda/pr_cuda.cpp:222–235  ·  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: vector of vector of tensors, b -> cell_idx -> pidx of points in the cell

Source from the content-addressed store, hash-verified

220// vector of vector of tensors, b -> cell_idx -> pidx of points in the cell
221//
222std::vector<std::vector<torch::Tensor> > gather_points_v1(
223 const torch::Tensor & grid_idxs, // (b, n), long
224 const torch::Tensor & total_cells, // (b,) int64_t
225 const torch::Tensor & valid_mask, // (b, n), bool
226 const torch::Tensor & cell_counts // (b, n_cells), int32
227) {
228
229 CHECK_INPUT(grid_idxs);
230 CHECK_INPUT(total_cells);
231 CHECK_INPUT(valid_mask);
232 CHECK_INPUT(cell_counts);
233
234 return gather_points_cuda(grid_idxs, total_cells, valid_mask, cell_counts);
235}
236
237
238// Gather the points belonging to each grid cell.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected