torch.sparse_csr_tensor — PyTorch 1.10.1 documentation
pytorch.org › torchtorch.sparse_csr_tensor. Constructs a sparse tensor in CSR (Compressed Sparse Row) with specified values at the given crow_indices and col_indices. Sparse matrix multiplication operations in CSR format are typically faster than that for sparse tensors in COO format. Make you have a look at the note on the data type of the indices.
torch.Tensor.is_sparse — PyTorch 1.10.1 documentation
pytorch.org › torchLearn about PyTorch’s features and capabilities. Community. Join the PyTorch developer community to contribute, learn, and get your questions answered. Developer Resources. Find resources and get questions answered. Forums. A place to discuss PyTorch code, issues, install, research. Models (Beta) Discover, publish, and reuse pre-trained models
torch.sparse_coo_tensor — PyTorch 1.10.1 documentation
pytorch.org › torchtorch.sparse_coo_tensor. Constructs a sparse tensor in COO (rdinate) format with specified values at the given indices. This function returns an uncoalesced tensor. indices ( array_like) – Initial data for the tensor. Can be a list, tuple, NumPy ndarray, scalar, and other types. Will be cast to a torch.LongTensor internally.
torch.sparse — PyTorch 1.10.1 documentation
pytorch.org › docs › stableIn PyTorch, the fill value of a sparse tensor cannot be specified explicitly and is assumed to be zero in general. However, there exists operations that may interpret the fill value differently. For instance, torch.sparse.softmax () computes the softmax with the assumption that the fill value is negative infinity.