nn.PointPillarsScatter

class horizon_plugin_pytorch.nn.PointPillarsScatter (output_shape=None)

Convert learned features from dense tensor to sparse pseudo image.

This replaces SECOND’s second.pytorch.voxelnet.SparseMiddleExtractor.

Parameters: output_shape – (List[int], optional). RExpected output shape. Defaults to None.

forward (voxel_features: Tensor, coords: Tensor, output_shape: Tensor | list | tuple | None = None)

Forward of Horizon PointPillarsScatter.

Parameters:

voxel_features (Tensor) – [M, …], dimention after M will be flattened.

coords (Tensor) – [M, (n, …, y, x)], only indices on N, H and W are used.

output_shape (Union[Tensor, list, tuple, None]) – Expected output shape. Defaults to None.

Returns: The NCHW pseudo image.

Return type: Tensor