Skip to content

Commit ac95b0e

Browse files
committed
Using py::arg_v to provide consise default Tensor values.
1 parent db0aa7d commit ac95b0e

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

cpp/pybind/t/geometry/lineset.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,10 @@ transformation as :math:`P = R(P) + t`)");
312312
line_set.def_static(
313313
"create_camera_visualization", &LineSet::CreateCameraVisualization,
314314
"view_width_px"_a, "view_height_px"_a, "intrinsic"_a, "extrinsic"_a,
315-
"scale"_a = 1.f, "color"_a = core::Tensor({}, core::Float32),
315+
"scale"_a = 1.f,
316+
py::arg_v(
317+
"color", core::Tensor({}, core::Float32),
318+
"open3d.core.Tensor([], dtype=open3d.core.Dtype.Float32)"),
316319
R"(Factory function to create a LineSet from intrinsic and extrinsic
317320
matrices. Camera reference frame is shown with XYZ axes in RGB.
318321

cpp/pybind/t/geometry/pointcloud.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,14 +432,18 @@ point clouds can be found in Piazza, Valentini, Varetti, "Mesh Reconstruction fr
432432
// processing
433433
pointcloud.def("project_to_depth_image", &PointCloud::ProjectToDepthImage,
434434
"width"_a, "height"_a, "intrinsics"_a,
435-
"extrinsics"_a = core::Tensor::Eye(4, core::Float32,
436-
core::Device("CPU:0")),
435+
py::arg_v("extrinsics",
436+
core::Tensor::Eye(4, core::Float32,
437+
core::Device("CPU:0")),
438+
"open3d.core.Tensor.eye(4)"),
437439
"depth_scale"_a = 1000.0, "depth_max"_a = 3.0,
438440
"Project a point cloud to a depth image.");
439441
pointcloud.def("project_to_rgbd_image", &PointCloud::ProjectToRGBDImage,
440442
"width"_a, "height"_a, "intrinsics"_a,
441-
"extrinsics"_a = core::Tensor::Eye(4, core::Float32,
442-
core::Device("CPU:0")),
443+
py::arg_v("extrinsics",
444+
core::Tensor::Eye(4, core::Float32,
445+
core::Device("CPU:0")),
446+
"open3d.core.Tensor.eye(4)"),
443447
"depth_scale"_a = 1000.0, "depth_max"_a = 3.0,
444448
"Project a colored point cloud to a RGBD image.");
445449
pointcloud.def(

cpp/pybind/t/pipelines/odometry/odometry.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,11 @@ void pybind_odometry_definitions(py::module &m) {
136136
py::detail::bind_copy_functions<OdometryResult>(odometry_result);
137137
odometry_result
138138
.def(py::init<core::Tensor, double, double>(),
139-
"transformation"_a = core::Tensor::Eye(4, core::Float64,
140-
core::Device("CPU:0")),
139+
py::arg_v("transformation",
140+
core::Tensor::Eye(4, core::Float64,
141+
core::Device("CPU:0")),
142+
"open3d.core.Tensor.eye(4, "
143+
"dtype=open3d.core.Dtype.Float64)"),
141144
"inlier_rmse"_a = 0.0, "fitness"_a = 0.0)
142145
.def_readwrite("transformation", &OdometryResult::transformation_,
143146
"``4 x 4`` float64 tensor on CPU: The estimated "

0 commit comments

Comments
 (0)