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:
SequentialSparse 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:
SequentialSparse 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:
ModuleSparse 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.