pub enum TyNat {
Lit(u64),
Var(TyVar),
Add(Box<TyNat>, Box<TyNat>),
Mul(Box<TyNat>, Box<TyNat>),
}Expand description
A type-level natural number.
Represents dimensions in shape-indexed tensor types. Supports both
concrete values (for static shapes) and variables (for polymorphic
operations like matmul).
Variants§
Lit(u64)
A concrete natural number literal.
Example: 1024 in Tensor '[1024, 768] Float
Var(TyVar)
A type-level natural variable.
Example: n in Tensor '[n] Float
Add(Box<TyNat>, Box<TyNat>)
Addition of two naturals.
Example: m + k for computing output dimensions
Mul(Box<TyNat>, Box<TyNat>)
Multiplication of two naturals.
Example: m * k for computing buffer sizes
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TyNat
impl<'de> Deserialize<'de> for TyNat
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 TyNat
impl StructuralPartialEq for TyNat
Auto Trait Implementations§
impl Freeze for TyNat
impl RefUnwindSafe for TyNat
impl Send for TyNat
impl Sync for TyNat
impl Unpin for TyNat
impl UnsafeUnpin for TyNat
impl UnwindSafe for TyNat
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