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:
| 255 | // (b, n_cells+1), |
| 256 | // |
| 257 | std::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 |
nothing calls this directly
no outgoing calls
no test coverage detected