From fa44a05567ea7e6c18c3e762e1260ade0040f08e Mon Sep 17 00:00:00 2001 From: Christoph Lassner Date: Sat, 10 Jul 2021 01:05:36 -0700 Subject: [PATCH] Fixing a bug that prevents opacity gradient calculation if no other gradients are required. Summary: An early-return test for gradient calculation did not include the opacity gradient calculation - hence would also return early without calculating gradients even if opacity gradients are required. Reviewed By: bottler Differential Revision: D29505684 fbshipit-source-id: 575e820b8f58b19476b2fe3288702806733e840b --- pytorch3d/csrc/pulsar/pytorch/renderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch3d/csrc/pulsar/pytorch/renderer.cpp b/pytorch3d/csrc/pulsar/pytorch/renderer.cpp index 635dee41..f57a1d49 100644 --- a/pytorch3d/csrc/pulsar/pytorch/renderer.cpp +++ b/pytorch3d/csrc/pulsar/pytorch/renderer.cpp @@ -1046,7 +1046,7 @@ Renderer::backward( at::optional, at::optional> ret; - if (mode == 1 || (!dif_pos && !dif_col && !dif_rad && !dif_cam)) { + if (mode == 1 || (!dif_pos && !dif_col && !dif_rad && !dif_cam && !dif_opy)) { return ret; } // Create the camera information.