Fix Pulsar backend batched radius handling.

Summary: This fixes a corner case for multi-radius handling for the pulsar backend. The additional dimensionality check ensures that the batched parsing for radiuses is only performed when appropriate.

Reviewed By: bottler

Differential Revision: D25387708

fbshipit-source-id: c486dcf327f812265b7ca8ca5ef5c6a31e6d4549
This commit is contained in:
Christoph Lassner 2020-12-21 13:00:47 -08:00 committed by Facebook GitHub Bot
parent ebac66daeb
commit caa3371376

View File

@ -399,7 +399,11 @@ class PulsarPointsRenderer(nn.Module):
raster_rad = self.rasterizer.raster_settings.radius
if kwargs.get("radius_world", False):
return raster_rad
if isinstance(raster_rad, torch.Tensor) and raster_rad.numel() > 1:
if (
isinstance(raster_rad, torch.Tensor)
and raster_rad.numel() > 1
and raster_rad.ndim > 1
):
# In this case it must be a batched torch tensor.
raster_rad = raster_rad[cloud_idx]
if orthogonal_projection: