Skip to content

Commit d631b56

Browse files
generatedunixname1417043136753450meta-codesync[bot]
authored andcommitted
fbcode/vision/fair/pytorch3d/pytorch3d/ops/sample_farthest_points.py
Reviewed By: sgrigory Differential Revision: D93708653 fbshipit-source-id: 112158092cd64ac8afddf1378b931cb44e19c372
1 parent 3ba2030 commit d631b56

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

pytorch3d/ops/sample_farthest_points.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ def sample_farthest_points_naive(
179179
# and all the other points. If a point has already been selected
180180
# it's distance will be 0.0 so it will not be selected again as the max.
181181
dist = points[n, selected_idx, :] - points[n, : lengths[n], :]
182-
# pyre-fixme[58]: `**` is not supported for operand types `Tensor` and
183-
# `int`.
184-
dist_to_last_selected = (dist**2).sum(-1) # (P - i)
182+
dist_to_last_selected = torch.square(dist).sum(-1) # (P - i)
185183

186184
# If closer than currently saved distance to one of the selected
187185
# points, then updated closest_dists

0 commit comments

Comments
 (0)