Skip to content

Commit

Permalink
Fixed last dimension size check so that it doesn't trivially pass. (#…
Browse files Browse the repository at this point in the history
…1815)

Summary:
Currently, it checks that the `2`th dimension of `p2` is the same size as the `2`th dimension of `p2` instead of `p1`.

Pull Request resolved: #1815

Reviewed By: MichaelRamamonjisoa

Differential Revision: D58586966

Pulled By: bottler

fbshipit-source-id: d4f723fa264f90fe368c10825c1acdfdc4c406dc
  • Loading branch information
kylevedder authored and facebook-github-bot committed Jun 17, 2024
1 parent 302da69 commit 717493c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch3d/csrc/knn/knn.cu
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ std::tuple<at::Tensor, at::Tensor> KNearestNeighborIdxCuda(

TORCH_CHECK((norm == 1) || (norm == 2), "Norm must be 1 or 2.");

TORCH_CHECK(p2.size(2) == D, "Point sets must have the same last dimension");
TORCH_CHECK(p1.size(2) == D, "Point sets must have the same last dimension");
auto long_dtype = lengths1.options().dtype(at::kLong);
auto idxs = at::zeros({N, P1, K}, long_dtype);
auto dists = at::zeros({N, P1, K}, p1.options());
Expand Down

0 comments on commit 717493c

Please sign in to comment.