Skip to content

Commit e58a730

Browse files
jenksptfacebook-github-bot
authored andcommitted
Fix dimension check (facebookresearch#524)
Summary: Fixes the assertion that `p1` and `p2` have the same last dimension. The issue was that `D` is set to equal `p2.size(2)`, and then `D` is compared to `p2.size(2)`. The fix instead compares `D` to `p1.size(2). Pull Request resolved: facebookresearch#524 Reviewed By: bottler Differential Revision: D26008688 Pulled By: nikhilaravi fbshipit-source-id: e32afe9da127d81b1a411d3c223b539a7400597b
1 parent 2ee11c7 commit e58a730

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch3d/csrc/knn/knn.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ std::tuple<at::Tensor, at::Tensor> KNearestNeighborBackwardCuda(
505505
const auto D = p2.size(2);
506506
const auto K = idxs.size(2);
507507

508-
TORCH_CHECK(p2.size(2) == D, "Point sets must have the same last dimension");
508+
TORCH_CHECK(p1.size(2) == D, "Point sets must have the same last dimension");
509509
TORCH_CHECK(idxs.size(0) == N, "KNN idxs must have the same batch dimension");
510510
TORCH_CHECK(
511511
idxs.size(1) == P1, "KNN idxs must have the same point dimension as p1");

0 commit comments

Comments
 (0)