BEV modules

class torch_lattice.nn.modules.bev.ToBEVConvolution(in_channels, out_channels, n_kernels, stride=1, dim=3, bias=False)[source]

Bases: Module

Converts a SparseTensor into a sparse BEV feature map.

Parameters:
reset_parameters()[source]
extra_repr()[source]

Return the extra representation of the module.

To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.

forward(input)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

Tensor

Parameters:

input (SparseTensor)

class torch_lattice.nn.modules.bev.ToBEVReduction(dim=3)[source]

Bases: Module

Parameters:

dim (int)

extra_repr()[source]

Return the extra representation of the module.

To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.

forward(input)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

SparseTensor

Parameters:

input (SparseTensor)

class torch_lattice.nn.modules.bev.ToDenseBEVConvolution(in_channels, out_channels, shape, offset=(0, 0, 0), dim=3, bias=False)[source]

Bases: Module

Converts a SparseTensor into a dense BEV feature map.

Group points with the same z value together and apply the same FC kernel. Aggregate the results by summing up all features within one BEV grid. .. note:: This module consumes larger memory than ToBEVHeightCompression.

Parameters:
  • in_channels (int) – Number of input channels

  • out_channels (int) – Number of output channels

  • shape (List[int] | Tuple[int, int, int] | Tensor) – Shape of BEV map

  • dim (int) – Coordinate dimension index for z. Coordinates are ordered (batch, x, y, z), so the default is 3.

  • bias (bool) – Whether to use bias

  • offset (Tuple[int, int, int])

extra_repr()[source]

Return the extra representation of the module.

To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.

reset_parameters()[source]
forward(input)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

Tensor

Parameters:

input (SparseTensor)

class torch_lattice.nn.modules.bev.ToBEVHeightCompression(channels, shape, offset=(0, 0, 0), dim=3)[source]

Bases: Module

Converts a SparseTensor to a flattened volumetric tensor.

Parameters:
  • channels (int) – Number of input channels

  • (Note – output channels = channels x #unique z values)

  • shape (List[int] | Tuple[int, int, int] | Tensor) – Shape of BEV map

  • dim (int) – Coordinate dimension index for z. Coordinates are ordered (batch, x, y, z), so the default is 3.

  • offset (Tuple[int, int, int])

extra_repr()[source]

Return the extra representation of the module.

To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.

Return type:

str

forward(input)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

Tensor

Parameters:

input (SparseTensor)