SemiSparseLayout¶
- class torchao.dtypes.SemiSparseLayout[source]¶
SemiSparseLayout is a layout class for handling semi-structured sparse matrices in affine quantized tensors. This layout is specifically designed to work with the 2:4 sparsity pattern, where two out of every four elements are pruned to zero. This class provides methods for preprocessing input tensors to conform to this sparsity pattern.