Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed usage of TensorFlow Status API #6091

Merged
merged 3 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/misc/KnnSearchOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/misc/NmsOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/misc/RadiusSearchOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions cpp/open3d/ml/tensorflow/misc/VoxelPoolingOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/misc/VoxelizeOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/pointnet/BallQueryOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
6 changes: 3 additions & 3 deletions cpp/open3d/ml/tensorflow/pointnet/InterpolateOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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");

Expand All @@ -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");
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/pointnet/RoiPoolOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/pointnet/SamplingOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
4 changes: 2 additions & 2 deletions cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/ml/tensorflow/tf_subsampling/tf_subsampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions cpp/open3d/t/geometry/TensorMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down