From e547490c41751365235f70dc22219375a276e0ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Magne?= <53355258+loicmagne@users.noreply.github.com> Date: Mon, 27 Mar 2023 07:19:48 +0200 Subject: [PATCH] scatter_add_ -> index_add_ (#179) --- nerfacc/vol_rendering.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nerfacc/vol_rendering.py b/nerfacc/vol_rendering.py index 193ebd89..2f464fc3 100644 --- a/nerfacc/vol_rendering.py +++ b/nerfacc/vol_rendering.py @@ -190,11 +190,10 @@ def accumulate_along_rays( n_rays = int(ray_indices.max()) + 1 # assert n_rays > ray_indices.max() - index = ray_indices[:, None].expand(-1, src.shape[-1]) outputs = torch.zeros( (n_rays, src.shape[-1]), device=src.device, dtype=src.dtype ) - outputs.scatter_add_(0, index, src) + outputs.index_add_(0, ray_indices, src) return outputs