torch.Tensor.to_sparse_csr
- Tensor.to_sparse_csr(dense_dim=None) → Tensor
Convert a tensor to compressed row storage format (CSR). Except for strided tensors, only works with 2D tensors. If the
selfis strided, then the number of dense dimensions could be specified, and a hybrid CSR tensor will be created, with dense_dim dense dimensions and self.dim() - 2 - dense_dim batch dimension.