mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2026-02-25 23:56:00 +08:00
fbcode/vision/fair/pytorch3d/pytorch3d/ops/sample_farthest_points.py
Reviewed By: sgrigory Differential Revision: D93708653 fbshipit-source-id: 112158092cd64ac8afddf1378b931cb44e19c372
This commit is contained in:
committed by
meta-codesync[bot]
parent
3ba2030aa4
commit
d631b56fba
@@ -179,9 +179,7 @@ def sample_farthest_points_naive(
|
||||
# and all the other points. If a point has already been selected
|
||||
# it's distance will be 0.0 so it will not be selected again as the max.
|
||||
dist = points[n, selected_idx, :] - points[n, : lengths[n], :]
|
||||
# pyre-fixme[58]: `**` is not supported for operand types `Tensor` and
|
||||
# `int`.
|
||||
dist_to_last_selected = (dist**2).sum(-1) # (P - i)
|
||||
dist_to_last_selected = torch.square(dist).sum(-1) # (P - i)
|
||||
|
||||
# If closer than currently saved distance to one of the selected
|
||||
# points, then updated closest_dists
|
||||
|
||||
Reference in New Issue
Block a user