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

Function collect_points_on_ray

pointersect/pr/cuda/pr_cuda.cpp:357–391  ·  view source on GitHub ↗

Given ray2gidx and gidx2pidx, construct ray2pidxs. Args: ray2gidx: (b, m, n_gidxs), gidx can be outside the grid n_ray2gidx: (b, m), number of neighbors each ray gidx2pidx_bank: (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). gidx_start_idx: (b, n_cells+1), cell starts at gidx_start_idx[i] and ends at gidx_start_idx[i+1] ray_or

Source from the content-addressed store, hash-verified

355// (b, m+1),
356//
357std::tuple<torch::Tensor, torch::Tensor, torch::Tensor> collect_points_on_ray(
358 const torch::Tensor & ray2gidx, // (b, m, n_gidxs) long
359 const torch::Tensor & n_ray2gidx, // (b, m) long
360 const torch::Tensor & gidx2pidx_bank, // (b, n) long
361 const torch::Tensor & gidx_start_idx, // (b, n_cells+1) int32
362 const torch::Tensor & points, // (b, n, 3), float
363 const torch::Tensor & ray_origins, // (b, m, 3), float
364 const torch::Tensor & ray_directions, // (b, m, 3), float
365 const torch::Tensor & ray_radius, // (b, )m float
366 const float t_min = 0.,
367 const float t_max = 1.0e12
368) {
369
370 CHECK_INPUT(ray2gidx);
371 CHECK_INPUT(n_ray2gidx);
372 CHECK_INPUT(gidx2pidx_bank);
373 CHECK_INPUT(gidx_start_idx);
374 CHECK_INPUT(points);
375 CHECK_INPUT(ray_origins);
376 CHECK_INPUT(ray_directions);
377 CHECK_INPUT(ray_radius);
378
379 return collect_points_on_ray_cuda(
380 ray2gidx,
381 n_ray2gidx,
382 gidx2pidx_bank,
383 gidx_start_idx,
384 points,
385 ray_origins,
386 ray_directions,
387 ray_radius,
388 t_min,
389 t_max
390 );
391}
392
393
394

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected