torchsparse#

init()[source]#

Initialize torchsparse.backends.benchmark = False.

cat(inputs: List[SparseTensor]) SparseTensor[source]#

Concatenate a list of sparse tensors.

Parameters:

inputs (List[SparseTensor]) – A list of sparse tensors.

Returns:

The concatenated sparse tensor.

Return type:

SparseTensor

class SparseTensor(feats: Tensor, coords: Tensor, stride: int | Tuple[int, ...] = 1)[source]#

Bases: object

SparseTensor is the main data structure for point cloud.

Parameters:
  • feats – 2D tensor with of shape N x C, where N is the number of points and C is the number of feature channels.

  • coords – 2D integer tensor with of shape N x 4, where the first three dimensions correspond to quantized x, y, z coordinates, and the last dimension denotes the batch index.

  • stride – The tensor stride of the current sparse tensor.

property F: Tensor#
property C: Tensor#
property s: Tuple[int, ...]#
cpu()[source]#
cuda()[source]#
half()[source]#
detach()[source]#
to(device: str, non_blocking: bool = True)[source]#
class PointTensor(feats, coords, idx_query=None, weights=None)[source]#

Bases: object

cuda()[source]#
detach()[source]#
to(device, non_blocking=True)[source]#