Sparse operators

reindex_sparse is the exact-support operation for decoder and context branches. It keeps target row order and coordinate identity, drops source-only rows, and fills target-only rows without routing through a pooling kernel.

prune keeps explicit row indices in caller order. prune_mask is the boolean-mask form and preserves feature gradients through selected rows.

sparse_from_coordinates(..., duplicate_reduction='mean') performs an unweighted feature mean for exact duplicate integer coordinates. Reduced coordinates retain their first-occurrence order.

torch_lattice.operators.cat(inputs, *, join='inner')[source]
Return type:

SparseTensor

Parameters:
torch_lattice.operators.generative_add(a, b)[source]
Return type:

SparseTensor

Parameters:
torch_lattice.operators.prune(input, rows)[source]

Keep sparse rows in caller-supplied order.

Return type:

SparseTensor

Parameters:
torch_lattice.operators.prune_mask(input, mask)[source]

Keep sparse rows selected by a boolean mask.

Return type:

SparseTensor

Parameters:
torch_lattice.operators.reindex_sparse(input, target, *, fill=0.0)[source]

Gather input features onto the exact row order of target.

Return type:

SparseTensor

Parameters:
torch_lattice.operators.sparse_add(lhs, rhs, *, join='outer', lhs_fill=0.0, rhs_fill=0.0)[source]
Return type:

SparseTensor

Parameters:
torch_lattice.operators.sparse_binary(lhs, rhs, op, *, join='outer', lhs_fill=0.0, rhs_fill=0.0)[source]
Return type:

SparseTensor

Parameters:
torch_lattice.operators.sparse_cat(inputs, *, join='inner')[source]
Return type:

SparseTensor

Parameters:
torch_lattice.operators.sparse_from_coordinates(coords, feats, *, stride=1, spatial_range=None, batch_counts=None, duplicate_reduction='none')[source]

Construct a sparse tensor with explicit duplicate-row semantics.

Return type:

SparseTensor

Parameters:
torch_lattice.operators.sparse_maximum(lhs, rhs, *, join='inner', lhs_fill=0.0, rhs_fill=0.0)[source]
Return type:

SparseTensor

Parameters:
torch_lattice.operators.sparse_minimum(lhs, rhs, *, join='inner', lhs_fill=0.0, rhs_fill=0.0)[source]
Return type:

SparseTensor

Parameters:
torch_lattice.operators.sparse_mul(lhs, rhs, *, join='inner', lhs_fill=0.0, rhs_fill=0.0)[source]
Return type:

SparseTensor

Parameters:
torch_lattice.operators.sparse_sub(lhs, rhs, *, join='outer', lhs_fill=0.0, rhs_fill=0.0)[source]
Return type:

SparseTensor

Parameters: