diff --git a/pytorch3d/ops/knn.py b/pytorch3d/ops/knn.py index 3ec6e3f0..aff9fc6f 100644 --- a/pytorch3d/ops/knn.py +++ b/pytorch3d/ops/knn.py @@ -145,6 +145,9 @@ def knn_points( if p1.shape[2] != p2.shape[2]: raise ValueError("pts1 and pts2 must have the same point dimension.") + p1 = p1.contiguous() + p2 = p2.contiguous() + P1 = p1.shape[1] P2 = p2.shape[1]