Skip to content

Commit

Permalink
remove legacy cross() usage (#20)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #20

Fix legacy cross usage. Future cross() call must have explicit dim parameter.

Currently it has warning:
```
Warning: Using torch.cross without specifying the dim arg is deprecated.
Please either pass the dim explicitly or simply use torch.linalg.cross.
The default value of dim will change to agree with that of linalg.cross in a future release. (function operator())
```

Reviewed By: yutingye

Differential Revision: D58848086

fbshipit-source-id: 9976650c62ab75bd894a853ad81e3595fa2e5c57
  • Loading branch information
Yijing-Meta authored and facebook-github-bot committed Jun 21, 2024
1 parent fa2fdfa commit f832c35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymomentum/tensor_momentum/tensor_skinning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ at::Tensor computeVertexNormals(
at::Tensor x3 =
at::index_select(vertex_positions, -2, triangles.select(-1, 2));

at::Tensor triangle_normals = at::cross(x2 - x1, x3 - x1);
at::Tensor triangle_normals = at::cross(x2 - x1, x3 - x1, -1);
at::Tensor vertex_normals = at::zeros_like(vertex_positions);
for (int64_t i = 0; i < 3; ++i) {
vertex_normals.index_add_(-2, triangles.select(-1, i), triangle_normals);
Expand Down

0 comments on commit f832c35

Please sign in to comment.