#[non_exhaustive]pub enum ShapeInferError {
CycleDetected,
Arity {
op: String,
expected: String,
found: usize,
},
InvalidRank {
op: String,
index: usize,
rank: usize,
detail: String,
},
MissingAttribute {
op: String,
attr: String,
},
Invalid {
op: String,
detail: String,
},
ShapeConflict {
value: ValueId,
axis: usize,
inferred: i64,
declared: i64,
},
RankConflict {
value: ValueId,
inferred: usize,
declared: usize,
},
}Expand description
An error produced while inferring shapes.
Inference is permissive by default: an unsupported operator or an
under-specified input never errors — the affected outputs are simply left
unresolved (see crate::InferenceReport). These variants are raised only
for genuine contract violations: a malformed graph (cycle), an operator used
with the wrong arity/rank, or — under MergePolicy::Strict — a concrete
dimension conflict between an inferred and a declared shape.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CycleDetected
The graph could not be topologically ordered (it contains a cycle).
Arity
An operator was invoked with the wrong number of inputs.
InvalidRank
An input had a rank the operator cannot accept.
MissingAttribute
An attribute required by the operator was missing or the wrong type.
Invalid
A structural inconsistency detected while applying an op rule (e.g. a
contraction-dimension mismatch in MatMul, or an out-of-range axis).
ShapeConflict
Under MergePolicy::Strict, an inferred
dimension disagreed with the value’s declared dimension. Only concrete
(static) disagreements are reported; symbolic differences are treated as
naming and never conflict (see crate::context::merge_shapes).
RankConflict
Under MergePolicy::Strict, an inferred
rank disagreed with the value’s declared rank.
Trait Implementations§
Source§impl Debug for ShapeInferError
impl Debug for ShapeInferError
Source§impl Display for ShapeInferError
impl Display for ShapeInferError
impl Eq for ShapeInferError
Source§impl Error for ShapeInferError
impl Error for ShapeInferError
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()