Skip to content

Commit be5d95e

Browse files
committed
Check the dimension of the input point cloud.
1 parent 0c78247 commit be5d95e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

torch_points_kernels/cubic_feature_sampling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ def cubic_feature_sampling(ptcloud, cubic_features, neighborhood_size=1):
5555
dist: torch.Tensor
5656
(B, n_pts, n_vertices, c), where n_vertices = (neighborhood_size * 2)^3
5757
"""
58+
if len(ptcloud.shape) != 3 or ptcloud.shape[2] != 3:
59+
raise ValueError('The input point cloud should be of size (B, n_pts, 3).')
60+
5861
h_scale = cubic_features.size(2) / 2
5962
ptcloud = ptcloud * h_scale + h_scale
6063
return CubicFeatureSamplingFunction.apply(

0 commit comments

Comments
 (0)