From 27ae3acabebfcc223b4eb764b70541f52a88e79b Mon Sep 17 00:00:00 2001 From: Nobuo Tsukamoto Date: Sun, 16 Apr 2023 22:19:43 +0900 Subject: [PATCH 1/3] Improved log output. --- cpp/open3d/t/geometry/TensorMap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/open3d/t/geometry/TensorMap.cpp b/cpp/open3d/t/geometry/TensorMap.cpp index 3eaefdecb5e..6bc58b27def 100644 --- a/cpp/open3d/t/geometry/TensorMap.cpp +++ b/cpp/open3d/t/geometry/TensorMap.cpp @@ -55,8 +55,8 @@ void TensorMap::AssertSizeSynchronized() const { for (auto& kv : *this) { if (kv.first != primary_key_ && kv.second.GetLength() != primary_size) { - fmt::format(" > Tensor \"{}\" has size {}.\n", kv.first, - kv.second.GetLength()); + ss << fmt::format(" > Tensor \"{}\" has size {}.\n", + kv.first, kv.second.GetLength()); } } utility::LogError("{}", ss.str()); From 9acb36404e0ec564336baf08434901934d0e44f9 Mon Sep 17 00:00:00 2001 From: Nobuo Tsukamoto Date: Sun, 16 Apr 2023 22:29:13 +0900 Subject: [PATCH 2/3] Fixed build error in tensorflow v2.10 or later. --- .../continuous_conv/ContinuousConvBackpropFilterOps.cpp | 2 +- .../ml/tensorflow/continuous_conv/ContinuousConvOps.cpp | 2 +- .../ContinuousConvTransposeBackpropFilterOps.cpp | 2 +- .../continuous_conv/ContinuousConvTransposeOps.cpp | 2 +- cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOps.cpp | 2 +- cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOps.cpp | 2 +- cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOps.cpp | 2 +- cpp/open3d/ml/tensorflow/misc/KnnSearchOps.cpp | 2 +- cpp/open3d/ml/tensorflow/misc/NmsOps.cpp | 2 +- cpp/open3d/ml/tensorflow/misc/RadiusSearchOps.cpp | 2 +- cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOps.cpp | 2 +- cpp/open3d/ml/tensorflow/misc/VoxelPoolingOps.cpp | 4 ++-- cpp/open3d/ml/tensorflow/misc/VoxelizeOps.cpp | 2 +- cpp/open3d/ml/tensorflow/pointnet/BallQueryOps.cpp | 2 +- cpp/open3d/ml/tensorflow/pointnet/InterpolateOps.cpp | 6 +++--- cpp/open3d/ml/tensorflow/pointnet/RoiPoolOps.cpp | 2 +- cpp/open3d/ml/tensorflow/pointnet/SamplingOps.cpp | 2 +- cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeOps.cpp | 4 ++-- .../tensorflow/sparse_conv/SparseConvBackpropFilterOps.cpp | 2 +- cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOps.cpp | 2 +- .../sparse_conv/SparseConvTransposeBackpropFilterOps.cpp | 2 +- .../ml/tensorflow/sparse_conv/SparseConvTransposeOps.cpp | 2 +- .../ml/tensorflow/tf_subsampling/tf_batch_subsampling.cpp | 2 +- cpp/open3d/ml/tensorflow/tf_subsampling/tf_subsampling.cpp | 2 +- 24 files changed, 28 insertions(+), 28 deletions(-) diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOps.cpp b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOps.cpp index a5c9bd1ffc5..3fa594026e2 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOps.cpp +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOps.cpp @@ -147,7 +147,7 @@ REGISTER_OP("Open3DContinuousConvBackpropFilter") } c->set_output(0, filters_shape); - return Status::OK(); + return Status(); }) .Doc(R"doc( Computes the backprop for the filter of the ContinuousConv diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOps.cpp b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOps.cpp index 549bcbc2e5e..154ed9e0813 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOps.cpp +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOps.cpp @@ -139,7 +139,7 @@ REGISTER_OP("Open3DContinuousConv") c->MakeShape({output_first_dim, output_channel_dim}); c->set_output(0, output_shape); - return Status::OK(); + return Status(); }) .Doc(R"doc( Continuous convolution of two pointclouds. diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOps.cpp b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOps.cpp index fe7dd41ca88..ae13c7fd12c 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOps.cpp +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOps.cpp @@ -166,7 +166,7 @@ REGISTER_OP("Open3DContinuousConvTransposeBackpropFilter") } c->set_output(0, filters_shape); - return Status::OK(); + return Status(); }) .Doc(R"doc( Computes the backrop for the filter of the ContinuousConvTranspose diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOps.cpp b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOps.cpp index f91f2d86acf..19a41bb40b3 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOps.cpp +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOps.cpp @@ -168,7 +168,7 @@ REGISTER_OP("Open3DContinuousConvTranspose") c->MakeShape({output_first_dim, output_channel_dim}); c->set_output(0, output_shape); - return Status::OK(); + return Status(); }) .Doc(R"doc( Continuous tranpose convolution of two pointclouds. diff --git a/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOps.cpp b/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOps.cpp index 4d271d50830..30e0989c089 100644 --- a/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOps.cpp @@ -52,7 +52,7 @@ REGISTER_OP("Open3DBuildSpatialHashTable") hash_table_splits_shape = MakeShapeHandle(c, batch_size + 1); c->set_output(2, hash_table_splits_shape); - return Status::OK(); + return Status(); }) .Doc(R"doc( Creates a spatial hash table meant as input for fixed_radius_search diff --git a/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOps.cpp b/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOps.cpp index a74ab8c752b..eeb2f02cffb 100644 --- a/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOps.cpp @@ -79,7 +79,7 @@ REGISTER_OP("Open3DFixedRadiusSearch") neighbors_distance_shape = c->MakeShape({0}); c->set_output(2, neighbors_distance_shape); - return Status::OK(); + return Status(); }) .Doc(R"doc( Computes the indices of all neighbors within a radius. diff --git a/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOps.cpp b/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOps.cpp index 5fb0a7f6457..cc2c935bbb8 100644 --- a/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOps.cpp @@ -58,7 +58,7 @@ REGISTER_OP("Open3DInvertNeighborsList") // the attributes will have the same shape c->set_output(2, inp_neighbors_attributes); - return Status::OK(); + return Status(); }) .Doc(R"doc( Inverts a neighbors list made of neighbors_index and neighbors_row_splits. diff --git a/cpp/open3d/ml/tensorflow/misc/KnnSearchOps.cpp b/cpp/open3d/ml/tensorflow/misc/KnnSearchOps.cpp index e68bcd53c50..112d022e28c 100644 --- a/cpp/open3d/ml/tensorflow/misc/KnnSearchOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/KnnSearchOps.cpp @@ -67,7 +67,7 @@ REGISTER_OP("Open3DKnnSearch") neighbors_distance_shape = c->MakeShape({0}); c->set_output(2, neighbors_distance_shape); - return Status::OK(); + return Status(); }) .Doc(R"doc( Computes the indices of k nearest neighbors. diff --git a/cpp/open3d/ml/tensorflow/misc/NmsOps.cpp b/cpp/open3d/ml/tensorflow/misc/NmsOps.cpp index 0b2ded2325f..b8341190ea1 100644 --- a/cpp/open3d/ml/tensorflow/misc/NmsOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/NmsOps.cpp @@ -34,7 +34,7 @@ REGISTER_OP("Open3DNms") keep_indices = c->MakeShape({c->UnknownDim()}); c->set_output(0, keep_indices); - return Status::OK(); + return Status(); }) .Doc(R"doc( Performs non-maximum suppression of bounding boxes. diff --git a/cpp/open3d/ml/tensorflow/misc/RadiusSearchOps.cpp b/cpp/open3d/ml/tensorflow/misc/RadiusSearchOps.cpp index 94d2e0d0097..3dd99b9e460 100644 --- a/cpp/open3d/ml/tensorflow/misc/RadiusSearchOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/RadiusSearchOps.cpp @@ -69,7 +69,7 @@ REGISTER_OP("Open3DRadiusSearch") neighbors_distance_shape = c->MakeShape({0}); c->set_output(2, neighbors_distance_shape); - return Status::OK(); + return Status(); }) .Doc(R"doc( Computes the indices and distances of all neighbours within a radius. diff --git a/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOps.cpp b/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOps.cpp index 14be37412c0..5226079e783 100644 --- a/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOps.cpp @@ -33,7 +33,7 @@ REGISTER_OP("Open3DReduceSubarraysSum") sums_shape = c->MakeShape({sums_size}); c->set_output(0, sums_shape); - return Status::OK(); + return Status(); }) .Doc(R"doc( Computes the sum for each subarray in a flat vector of arrays. diff --git a/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOps.cpp b/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOps.cpp index 64e88539db0..ec163ea415b 100644 --- a/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOps.cpp @@ -53,7 +53,7 @@ REGISTER_OP("Open3DVoxelPooling") c->WithValue(c->Dim(positions_shape, -1), 3, &d)); } - return Status::OK(); + return Status(); }) .Doc(R"doc( Spatial pooling for point clouds by combining points that fall into the same voxel bin. @@ -202,7 +202,7 @@ REGISTER_OP("Open3DVoxelPoolingGrad") c->Dim(pooled_positions_shape, -1), 3, &d)); } - return Status::OK(); + return Status(); }) .Doc(R"doc( Gradient for features in VoxelPooling. For internal use only. diff --git a/cpp/open3d/ml/tensorflow/misc/VoxelizeOps.cpp b/cpp/open3d/ml/tensorflow/misc/VoxelizeOps.cpp index e9eb3c19f63..7c345edfd3f 100644 --- a/cpp/open3d/ml/tensorflow/misc/VoxelizeOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/VoxelizeOps.cpp @@ -58,7 +58,7 @@ REGISTER_OP("Open3DVoxelize") voxel_batch_splits = c->MakeShape({c->UnknownDim()}); c->set_output(3, voxel_batch_splits); - return Status::OK(); + return Status(); }) .Doc(R"doc( Voxelization for point clouds. diff --git a/cpp/open3d/ml/tensorflow/pointnet/BallQueryOps.cpp b/cpp/open3d/ml/tensorflow/pointnet/BallQueryOps.cpp index 2b0c863e279..07d7a03d34f 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/BallQueryOps.cpp +++ b/cpp/open3d/ml/tensorflow/pointnet/BallQueryOps.cpp @@ -32,6 +32,6 @@ REGISTER_OP("Open3DBallQuery") ::tensorflow::shape_inference::ShapeHandle output = c->MakeShape({c->Dim(dims1, 0), c->Dim(dims1, 1), nsample}); c->set_output(0, output); - return Status::OK(); + return Status(); }) .Doc(R"doc( TODO )doc"); diff --git a/cpp/open3d/ml/tensorflow/pointnet/InterpolateOps.cpp b/cpp/open3d/ml/tensorflow/pointnet/InterpolateOps.cpp index 18363a9e265..f16e9020609 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/InterpolateOps.cpp +++ b/cpp/open3d/ml/tensorflow/pointnet/InterpolateOps.cpp @@ -30,7 +30,7 @@ REGISTER_OP("Open3DThreeNN") c->MakeShape({c->Dim(dims1, 0), c->Dim(dims1, 1), 3}); c->set_output(0, output); c->set_output(1, output); - return Status::OK(); + return Status(); }) .Doc(R"doc( TODO )doc"); @@ -50,7 +50,7 @@ REGISTER_OP("Open3DThreeInterpolate") ::tensorflow::shape_inference::ShapeHandle output = c->MakeShape( {c->Dim(dims1, 0), c->Dim(dims1, 1), c->Dim(dims2, 1)}); c->set_output(0, output); - return Status::OK(); + return Status(); }) .Doc(R"doc( TODO )doc"); @@ -70,6 +70,6 @@ REGISTER_OP("Open3DThreeInterpolateGrad") c->MakeShape({c->Dim(dims1, 0), c->Dim(dims1, 1), M}); c->set_output(0, output); c->set_output(1, output); - return Status::OK(); + return Status(); }) .Doc(R"doc( TODO )doc"); diff --git a/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOps.cpp b/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOps.cpp index 10b72a5b4b2..8a72b3b0027 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOps.cpp +++ b/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOps.cpp @@ -42,6 +42,6 @@ REGISTER_OP("Open3DRoiPool") ::tensorflow::shape_inference::ShapeHandle output2 = c->MakeShape({c->Dim(dims1, 0), c->Dim(dims1, 1)}); c->set_output(1, output2); - return Status::OK(); + return Status(); }) .Doc(R"doc( TODO )doc"); diff --git a/cpp/open3d/ml/tensorflow/pointnet/SamplingOps.cpp b/cpp/open3d/ml/tensorflow/pointnet/SamplingOps.cpp index 1c1cad2f3e2..b33a636d3f1 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/SamplingOps.cpp +++ b/cpp/open3d/ml/tensorflow/pointnet/SamplingOps.cpp @@ -30,6 +30,6 @@ REGISTER_OP("Open3DFurthestPointSampling") ::tensorflow::shape_inference::ShapeHandle output = c->MakeShape({c->Dim(dims1, 0), npoint}); c->set_output(0, output); - return Status::OK(); + return Status(); }) .Doc(R"doc( TODO )doc"); diff --git a/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeOps.cpp b/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeOps.cpp index edf77e60268..7097f5f3287 100644 --- a/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeOps.cpp +++ b/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeOps.cpp @@ -51,7 +51,7 @@ REGISTER_OP("Open3DTrilinearDevoxelize") c->set_output(1, out2); c->set_output(2, out2); - return Status::OK(); + return Status(); }) .Doc(R"doc( Trilinear Devoxelize. @@ -167,7 +167,7 @@ REGISTER_OP("Open3DTrilinearDevoxelizeGrad") c->set_output(0, out); - return Status::OK(); + return Status(); }) .Doc(R"doc( Gradient function for Trilinear Devoxelize op. diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOps.cpp b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOps.cpp index 70916caf16e..5cc83701568 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOps.cpp +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOps.cpp @@ -66,7 +66,7 @@ REGISTER_OP("Open3DSparseConvBackpropFilter") CHECK_SHAPE_HANDLE(c, out_features_gradient, num_out, out_channels); c->set_output(0, filters); - return Status::OK(); + return Status(); }) .Doc(R"doc( Computes the backprop for the filter of the SparseConv diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOps.cpp b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOps.cpp index 2dd55fd3551..264a443ef25 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOps.cpp +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOps.cpp @@ -66,7 +66,7 @@ REGISTER_OP("Open3DSparseConv") ShapeHandle out_features_shape = MakeShapeHandle(c, num_out, out_channels); c->set_output(0, out_features_shape); - return Status::OK(); + return Status(); }) .Doc(R"doc( General sparse convolution. diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOps.cpp b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOps.cpp index a2482d19eab..af9741ad39e 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOps.cpp +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOps.cpp @@ -71,7 +71,7 @@ REGISTER_OP("Open3DSparseConvTransposeBackpropFilter") CHECK_SHAPE_HANDLE(c, out_features_gradient, num_out, out_channels); c->set_output(0, filters); - return Status::OK(); + return Status(); }) .Doc(R"doc( Computes the backrop for the filter of the SparseConvTranspose diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOps.cpp b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOps.cpp index 2b5035521b2..a1daf49a16c 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOps.cpp +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOps.cpp @@ -75,7 +75,7 @@ REGISTER_OP("Open3DSparseConvTranspose") ShapeHandle out_features_shape = MakeShapeHandle(c, num_out, out_channels); c->set_output(0, out_features_shape); - return Status::OK(); + return Status(); }) .Doc(R"doc( Sparse tranpose convolution of two pointclouds. diff --git a/cpp/open3d/ml/tensorflow/tf_subsampling/tf_batch_subsampling.cpp b/cpp/open3d/ml/tensorflow/tf_subsampling/tf_batch_subsampling.cpp index 3425a436146..74472a667f4 100644 --- a/cpp/open3d/ml/tensorflow/tf_subsampling/tf_batch_subsampling.cpp +++ b/cpp/open3d/ml/tensorflow/tf_subsampling/tf_batch_subsampling.cpp @@ -47,7 +47,7 @@ REGISTER_OP("Open3DBatchGridSubsampling") TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 2, &input0_shape)); c->set_output(0, input0_shape); c->set_output(1, c->input(1)); - return Status::OK(); + return Status(); }); class BatchGridSubsamplingOp : public OpKernel { diff --git a/cpp/open3d/ml/tensorflow/tf_subsampling/tf_subsampling.cpp b/cpp/open3d/ml/tensorflow/tf_subsampling/tf_subsampling.cpp index 31b2d51571c..fd7162966f8 100644 --- a/cpp/open3d/ml/tensorflow/tf_subsampling/tf_subsampling.cpp +++ b/cpp/open3d/ml/tensorflow/tf_subsampling/tf_subsampling.cpp @@ -44,7 +44,7 @@ REGISTER_OP("Open3DGridSubsampling") ::tensorflow::shape_inference::ShapeHandle input; TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 2, &input)); c->set_output(0, input); - return Status::OK(); + return Status(); }); class GridSubsamplingOp : public OpKernel { From ef76d424a9b5dd78aded5aac48ad6c220ad8f61e Mon Sep 17 00:00:00 2001 From: Nobuo Tsukamoto Date: Wed, 19 Apr 2023 21:54:04 +0900 Subject: [PATCH 3/3] Apply style TensorMap.cpp. --- cpp/open3d/t/geometry/TensorMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/open3d/t/geometry/TensorMap.cpp b/cpp/open3d/t/geometry/TensorMap.cpp index 6bc58b27def..f47bcaf0955 100644 --- a/cpp/open3d/t/geometry/TensorMap.cpp +++ b/cpp/open3d/t/geometry/TensorMap.cpp @@ -56,7 +56,7 @@ void TensorMap::AssertSizeSynchronized() const { if (kv.first != primary_key_ && kv.second.GetLength() != primary_size) { ss << fmt::format(" > Tensor \"{}\" has size {}.\n", - kv.first, kv.second.GetLength()); + kv.first, kv.second.GetLength()); } } utility::LogError("{}", ss.str());