torch.Tensor.crow_indices
- Tensor.crow_indices() → IntTensor
Returns the tensor containing the compressed row indices of the
selftensor whenselfis a sparse CSR tensor of layoutsparse_csr. Thecrow_indicestensor is strictly of shape (.size(0) + 1) and of type or . When using MKL routines such as sparse matrix multiplication, it is necessary to use indexing in order to avoid downcasting and potentially losing information.