Skip to content

Commit 6c09178

Browse files
authored
Fix NaNs in rasterizeTopContributingGaussianIdsForward weights (#400)
I was finding that `rasterizeTopContributingGaussianIdsForward` during training could occasionally produce NaNs in its returned weights. Logically I don't understand how a condition like this could be reached, but initializing the output weights to zeros (instead of `torch::empty`), mitigates this issue. Signed-off-by: Jonathan Swartz <[email protected]>
1 parent 8899398 commit 6c09178

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fvdb/detail/ops/gsplat/GaussianRasterizeTopContributingGaussianIds.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ launchRasterizeTopContributingGaussianIdsForwardKernel(
387387
idsToRenderVec.push_back(
388388
torch::empty({size, settings.numDepthSamples}, means2d.options().dtype(torch::kInt32)));
389389
weightsToRenderVec.push_back(
390-
torch::empty({size, settings.numDepthSamples},
390+
torch::zeros({size, settings.numDepthSamples},
391391
means2d.options().dtype(c10::CppTypeToScalarType<ScalarType>::value)));
392392
}
393393

0 commit comments

Comments
 (0)