From 242c23f0f067064c16c49376c02271cd1cd2303b Mon Sep 17 00:00:00 2001 From: Maxim Bonnaerens Date: Wed, 30 Aug 2023 00:07:43 +0200 Subject: [PATCH] cast background to device (#2381) * cast background_color to device * make onliner instead --- nerfstudio/model_components/renderers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerfstudio/model_components/renderers.py b/nerfstudio/model_components/renderers.py index d5f2945a4..8bc5b4d78 100644 --- a/nerfstudio/model_components/renderers.py +++ b/nerfstudio/model_components/renderers.py @@ -116,7 +116,7 @@ class RGBRenderer(nn.Module): background_color = rgb[..., -1, :] assert isinstance(background_color, torch.Tensor) - comp_rgb = comp_rgb + background_color * (1.0 - accumulated_weight) + comp_rgb = comp_rgb + background_color.to(comp_rgb.device) * (1.0 - accumulated_weight) return comp_rgb @classmethod