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
This commit is contained in:
Christoph Lassner 2021-07-10 01:05:36 -07:00 committed by Facebook GitHub Bot
parent 75432a0695
commit fa44a05567

View File

@ -1046,7 +1046,7 @@ Renderer::backward(
at::optional<torch::Tensor>,
at::optional<torch::Tensor>>
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.