fbcode/vision/fair/pytorch3d/pytorch3d/loss/mesh_laplacian_smoothing.py

Reviewed By: bottler

Differential Revision: D93709347

fbshipit-source-id: 69710e6082a0785126a121e26f1d96a571360f1d
This commit is contained in:
generatedunixname1417043136753450
2026-02-22 07:08:02 -08:00
committed by meta-codesync[bot]
parent e70188ebbc
commit eabb511410

View File

@@ -114,9 +114,7 @@ def mesh_laplacian_smoothing(meshes, method: str = "uniform"):
if method == "cot":
norm_w = torch.sparse.sum(L, dim=1).to_dense().view(-1, 1)
idx = norm_w > 0
# pyre-fixme[58]: `/` is not supported for operand types `float` and
# `Tensor`.
norm_w[idx] = 1.0 / norm_w[idx]
norm_w[idx] = torch.reciprocal(norm_w[idx])
else:
L_sum = torch.sparse.sum(L, dim=1).to_dense().view(-1, 1)
norm_w = 0.25 * inv_areas