pub enum Error {
Show 37 variants
DTypeMismatch {
lhs: DType,
rhs: DType,
},
TypePromotionFailed {
lhs: DType,
rhs: DType,
},
InvalidDTypeForUnaryOp {
operation: UnaryOp,
dtype: DType,
},
InvalidDTypeForBinaryOp {
operation: BinaryOp,
dtypes: SmallVec<[DType; 2]>,
},
VoidTypeInOp,
IndexTypeMismatch {
actual: DType,
},
DivisionByZero,
ReshapeSizeMismatch {
input_size: usize,
output_size: usize,
},
ShrinkBoundsViolation {
dim: usize,
begin: usize,
end: usize,
shape_size: usize,
},
BindValueOutOfRange {
value: i64,
min: i64,
max: i64,
},
IndexOutOfBounds,
ExpandDimensionMismatch {
input_dims: usize,
output_dims: usize,
},
ExpandInvalidDimension {
dim: usize,
input: usize,
output: usize,
},
PermuteInvalidPermutation {
permutation: Vec<usize>,
expected_dims: usize,
},
PadNegativeValue {
dim: usize,
begin: isize,
end: isize,
},
PadDimensionMismatch {
padding_dims: usize,
shape_dims: usize,
},
FlipInvalidSpec {
expected_dims: usize,
got_dims: usize,
},
ReduceAxisInvalid {
axis: i32,
shape_dims: usize,
},
ShapeMismatch {
lhs_shape: Vec<usize>,
rhs_shape: Vec<usize>,
},
BinaryShapeMismatch {
op: BinaryOp,
lhs: Box<Shape>,
rhs: Box<Shape>,
},
ReshapeNegativeDimension {
shape: SmallVec<[isize; 4]>,
},
BroadcastShapeMismatch {
lhs: Box<Shape>,
rhs: Box<Shape>,
},
SymbolicPaddingUnsupported,
SymbolicShrinkingUnsupported,
SymbolicShapeUnsupported {
operation: String,
},
SymbolicBufferSize {
bound: ConstValue,
},
TernaryBranchShapeMismatch {
true_branch: Box<Shape>,
false_branch: Box<Shape>,
},
BufferDefRequiresPtrDType {
op: &'static str,
dtype: DType,
},
VectorizeEmpty,
VectorizeDTypeMismatch {
expected: DType,
actual: DType,
},
GepIndexOutOfBounds {
index: usize,
vcount: usize,
},
GepRequiresVector {
dtype: DType,
},
ContractCountMismatch {
dtype_count: usize,
axis_product: usize,
},
UnrollCountMismatch {
dtype_count: usize,
axis_product: usize,
},
WhereConditionNotBool {
actual: DType,
},
BroadcastRequiresScalar {
dtype: DType,
},
MulAccDtypeMismatch {
a_dtype: DType,
b_dtype: DType,
c_dtype: DType,
},
}Variants§
DTypeMismatch
DType mismatch in binary operation.
TypePromotionFailed
Type promotion failed - no common type.
InvalidDTypeForUnaryOp
Invalid dtype for operation (e.g., bitwise on float).
InvalidDTypeForBinaryOp
Invalid dtype for operation (e.g., bitwise on float).
VoidTypeInOp
Void dtype cannot be used in operations.
IndexTypeMismatch
Index parameter must have Index dtype.
DivisionByZero
Division by zero.
ReshapeSizeMismatch
Reshape size mismatch.
ShrinkBoundsViolation
Shrink bounds violation.
BindValueOutOfRange
Bind value out of range.
IndexOutOfBounds
Index out of bounds.
ExpandDimensionMismatch
Expand dimension count mismatch.
ExpandInvalidDimension
Expand invalid dimension (can only expand dimensions of size 1).
PermuteInvalidPermutation
Permute has invalid permutation.
PadNegativeValue
Pad has negative padding value.
PadDimensionMismatch
Pad dimension count mismatch.
FlipInvalidSpec
Flip specification invalid.
ReduceAxisInvalid
Reduce axis invalid.
ShapeMismatch
Shape mismatch in elementwise operation.
BinaryShapeMismatch
Shape mismatch in binary operation.
ReshapeNegativeDimension
Reshape contains negative dimension.
BroadcastShapeMismatch
Broadcasting shape mismatch.
SymbolicPaddingUnsupported
Symbolic padding unsupported.
SymbolicShrinkingUnsupported
Symbolic shrinking unsupported.
SymbolicShapeUnsupported
Symbolic shape unsupported.
SymbolicBufferSize
Symbolic buffer size unsupported.
Fields
bound: ConstValueTernaryBranchShapeMismatch
Ternary branch shape mismatch.
BufferDefRequiresPtrDType
DefineLocal must have Ptr dtype.
VectorizeEmpty
VECTORIZE requires at least one element.
VectorizeDTypeMismatch
VECTORIZE elements have mismatched dtypes.
GepIndexOutOfBounds
GEP index out of bounds.
GepRequiresVector
GEP requires vector source.
ContractCountMismatch
CONTRACT dtype count != axis product.
UnrollCountMismatch
UNROLL src dtype count != axis product.
WhereConditionNotBool
WHERE condition must be bool.
BroadcastRequiresScalar
BROADCAST requires scalar source.
MulAccDtypeMismatch
MulAcc operands must have matching dtypes.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
replaced by Error::source, which can support downcasting
Source§impl ErrorCompat for Error
impl ErrorCompat for Error
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Error::source. Read more