pub enum IndexExpr {
Var(String),
Const(i64),
Add(Box<IndexExpr>, Box<IndexExpr>),
Sub(Box<IndexExpr>, Box<IndexExpr>),
Mul(Box<IndexExpr>, Box<IndexExpr>),
Div(Box<IndexExpr>, Box<IndexExpr>),
Min(Box<IndexExpr>, Box<IndexExpr>),
Max(Box<IndexExpr>, Box<IndexExpr>),
}Expand description
Index expression for dimension calculations.
Index expressions represent compile-time or runtime values used in type indices, particularly for tensor dimensions.
Variants§
Var(String)
Variable index (e.g., n, m)
Const(i64)
Constant index value
Add(Box<IndexExpr>, Box<IndexExpr>)
Addition: e1 + e2
Sub(Box<IndexExpr>, Box<IndexExpr>)
Subtraction: e1 - e2
Mul(Box<IndexExpr>, Box<IndexExpr>)
Multiplication: e1 * e2
Div(Box<IndexExpr>, Box<IndexExpr>)
Division: e1 / e2
Min(Box<IndexExpr>, Box<IndexExpr>)
Minimum: min(e1, e2)
Max(Box<IndexExpr>, Box<IndexExpr>)
Maximum: max(e1, e2)
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for IndexExpr
impl<'de> Deserialize<'de> for IndexExpr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for IndexExpr
impl StructuralPartialEq for IndexExpr
Auto Trait Implementations§
impl Freeze for IndexExpr
impl RefUnwindSafe for IndexExpr
impl Send for IndexExpr
impl Sync for IndexExpr
impl Unpin for IndexExpr
impl UnwindSafe for IndexExpr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more