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

Function PYBIND11_MODULE

pointersect/pr/cpp/pr.cpp:961–980  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

959
960namespace py = pybind11;
961PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
962
963 // The following functions should not be called in python.
964 // They are exposed for unit-testing.
965 py::class_<idxmap>(m, "idxmap")
966 .def(py::init())
967 .def(py::init<size_t>())
968 .def(py::init<const Table &>())
969 .def("insert", &idxmap::insert)
970 .def("get_pidx", &idxmap::get_pidx)
971 .def("get_table", &idxmap::get_table);
972
973 m.def("sub2ind", &sub2ind, "Sub index to linear index");
974 m.def("ind2sub", &ind2sub, "linear index to sub index");
975 m.def("gather_points", &gather_points, "Gather points in each grid cell");
976 m.def("get_grid_idx", &get_grid_idx, "Compute the grid index a xyz point belongs to");
977 m.def("grid_ray_intersection", &grid_ray_intersection, "Find out what are the grid cells a ray intersects with");
978 m.def("grid_ray_intersection_v2", &grid_ray_intersection_v2, "Find out what are the grid cells a ray intersects with");
979 m.def("find_neighbor_points_of_rays", &find_neighbor_points_of_rays, "Find the neighboring points of a ray");
980}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected