Files
pytorch3d/tests
Roman Shapovalov 3b5ab51de5 Fix backprop through cot_laplacian
Summary:
`_cot_laplacian_python` used in-place tensor operations (`clamp_`, `/=`,
`+=`) on intermediates that participate in autograd. Once the resulting
sparse Laplacian is used in a backward pass, these in-place mutations
raise a runtime error:

```
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.sparse.FloatTensor [4, 4]], which is output 0 of SparseCooTensorWithDimsAndTensors, is at version 1; expected version 0 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True, check_nan=False).
```

Replace the in-place ops with out-of-place equivalents so gradients can
flow back to the input vertices.

- `clamp_` → `clamp`
- `cot /= 4.0` → `cot = cot / 4.0`
- `L += L.t()` → `L = L + L.t()`

Reviewed By: bottler

Differential Revision: D111896032

fbshipit-source-id: 4c36677487bae5d37a9d81cb791400576f4b2c5f
2026-07-14 12:07:08 -07:00
..
2022-01-04 11:43:38 -08:00
2025-08-27 06:55:50 -07:00
2022-05-25 06:16:03 -07:00
2025-07-10 05:20:22 -07:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2024-02-16 08:19:12 -08:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2024-11-20 09:15:51 -08:00
2023-12-04 13:43:34 -08:00
2024-11-06 11:13:59 -08:00
2025-08-27 06:55:50 -07:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2025-10-09 08:17:20 -07:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2025-08-27 06:55:50 -07:00
2025-08-27 06:55:50 -07:00
2025-09-04 08:31:32 -07:00
2022-05-25 06:16:03 -07:00
2022-05-25 06:16:03 -07:00
2025-09-04 08:31:32 -07:00
2022-05-25 06:16:03 -07:00
2024-03-12 06:59:31 -07:00
2023-01-25 01:56:36 -08:00
2020-01-23 11:53:46 -08:00