torchsparse.backbones.modules#

class SparseConvBlock(in_channels: int, out_channels: int, kernel_size: int | List[int] | Tuple[int, ...], stride: int | List[int] | Tuple[int, ...] = 1, dilation: int = 1)[source]#

Bases: Sequential

Sparse convolution block.

class SparseConvTransposeBlock(in_channels: int, out_channels: int, kernel_size: int | List[int] | Tuple[int, ...], stride: int | List[int] | Tuple[int, ...] = 1, dilation: int = 1)[source]#

Bases: Sequential

Sparse convolution transpose block.

class SparseResBlock(in_channels: int, out_channels: int, kernel_size: int | List[int] | Tuple[int, ...], stride: int | List[int] | Tuple[int, ...] = 1, dilation: int = 1)[source]#

Bases: Module

Sparse residual block.

forward(x: SparseTensor) SparseTensor[source]#

Defines 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.

training: bool#