Skip to content

Commit

Permalink
scatter_add_ -> index_add_ (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmagne authored Mar 27, 2023
1 parent 9a1c0ab commit e547490
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nerfacc/vol_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit e547490

Please sign in to comment.