pub struct DType(/* private fields */);Expand description
A TOSA tensor data-type discriminant.
Raw values remain representable so policy and diagnostic utilities can discuss newer schemas.
Successfully parsed models contain only values accepted by DType::is_tosa_1_0.
Implementations§
Source§impl DType
impl DType
pub const BOOL: Self
pub const INT4: Self
pub const INT8: Self
pub const INT16: Self
pub const INT32: Self
pub const INT48: Self
pub const FP32: Self
pub const FP16: Self
pub const BF16: Self
pub const SHAPE: Self
pub const FP8E4M3: Self
pub const FP8E5M2: Self
pub const fn new(raw: u32) -> Self
pub const fn get(self) -> u32
pub const fn is_tosa_1_0(self) -> bool
pub fn name(self) -> Option<&'static str>
Trait Implementations§
impl Copy for DType
impl Eq for DType
Source§impl Ord for DType
impl Ord for DType
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for DType
impl PartialOrd for DType
impl StructuralPartialEq for DType
Auto Trait Implementations§
impl Freeze for DType
impl RefUnwindSafe for DType
impl Send for DType
impl Sync for DType
impl Unpin for DType
impl UnsafeUnpin for DType
impl UnwindSafe for DType
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