pub enum SparseTensorError {
Show 18 variants
InvalidIndicesRank {
expected: usize,
actual: usize,
},
InvalidIndicesDType {
actual: DType,
},
DeviceMismatch {
expected: Device,
actual: Device,
},
SparseDimMismatch {
indices_sparse_dim: usize,
expected: usize,
},
NnzMismatch {
indices_nnz: usize,
values_nnz: usize,
},
InvalidValuesShape {
expected: Vec<usize>,
actual: Vec<usize>,
},
IndexOutOfBounds {
dim: usize,
index: i64,
size: usize,
},
NegativeIndex {
dim: usize,
index: i64,
},
InvalidCrowIndicesLen {
expected: usize,
actual: usize,
},
InvalidColIndicesLen {
expected: usize,
actual: usize,
},
NonMonotonicCrowIndices {
row: usize,
prev: i64,
curr: i64,
},
InvalidCrowIndexValue {
index: usize,
value: i64,
},
ColIndexOutOfBounds {
index: i64,
ncols: usize,
},
DuplicateCsrColumn {
row: usize,
col: i64,
},
DuplicateCooIndex {
position: usize,
coord: Vec<i64>,
},
UnsortedCooIndex {
position: usize,
previous: Vec<i64>,
current: Vec<i64>,
},
DenseTensor(DenseTensorError),
UnsupportedRank {
rank: usize,
},
}Expand description
Error type for sparse tensor operations.
Variants§
InvalidIndicesRank
Indices tensor has wrong rank (expected 2 for COO).
InvalidIndicesDType
Indices tensor has wrong dtype (must be I64).
DeviceMismatch
Indices tensor is on a different device than values.
SparseDimMismatch
Indices sparse_dim doesn’t match the dense shape.
NnzMismatch
Number of non-zero entries doesn’t match between indices and values.
InvalidValuesShape
Values tensor shape doesn’t match expected [nnz, *dense_dims].
IndexOutOfBounds
Index out of bounds for the dense shape.
NegativeIndex
Negative index in indices tensor.
InvalidCrowIndicesLen
CSR crow_indices has wrong length (expected nrows + 1).
InvalidColIndicesLen
CSR col_indices has wrong length (expected nnz).
NonMonotonicCrowIndices
CSR crow_indices values are not monotonically increasing.
InvalidCrowIndexValue
CSR crow_indices contains an invalid value.
ColIndexOutOfBounds
CSR column index out of bounds.
DuplicateCsrColumn
CSR row contains the same column index more than once.
DuplicateCooIndex
A coalesced COO tensor contains duplicate coordinates.
UnsortedCooIndex
A coalesced COO tensor contains coordinates out of lexicographic order.
DenseTensor(DenseTensorError)
Dense tensor error during conversion.
UnsupportedRank
Only 2D sparse CSR tensors are supported.
Trait Implementations§
Source§impl Clone for SparseTensorError
impl Clone for SparseTensorError
Source§fn clone(&self) -> SparseTensorError
fn clone(&self) -> SparseTensorError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SparseTensorError
impl Debug for SparseTensorError
Source§impl Display for SparseTensorError
impl Display for SparseTensorError
impl Eq for SparseTensorError
Source§impl Error for SparseTensorError
impl Error for SparseTensorError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()