pub enum ScalarType {
Bool,
Int(u8),
UInt(u8),
Float(u8),
}Expand description
Scalar types in Loop IR.
Variants§
Bool
Boolean.
Int(u8)
Signed integer with bit width.
UInt(u8)
Unsigned integer with bit width.
Float(u8)
Floating point with bit width.
Implementations§
Source§impl ScalarType
impl ScalarType
Sourcepub const fn size_bytes(self) -> usize
pub const fn size_bytes(self) -> usize
Returns the size in bytes.
Sourcepub fn from_dtype(dtype: DType) -> Self
pub fn from_dtype(dtype: DType) -> Self
Converts from tensor DType.
Trait Implementations§
Source§impl Clone for ScalarType
impl Clone for ScalarType
Source§fn clone(&self) -> ScalarType
fn clone(&self) -> ScalarType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScalarType
impl Debug for ScalarType
Source§impl<'de> Deserialize<'de> for ScalarType
impl<'de> Deserialize<'de> for ScalarType
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
Source§impl Hash for ScalarType
impl Hash for ScalarType
Source§impl PartialEq for ScalarType
impl PartialEq for ScalarType
Source§fn eq(&self, other: &ScalarType) -> bool
fn eq(&self, other: &ScalarType) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ScalarType
impl Serialize for ScalarType
impl Copy for ScalarType
impl Eq for ScalarType
impl StructuralPartialEq for ScalarType
Auto Trait Implementations§
impl Freeze for ScalarType
impl RefUnwindSafe for ScalarType
impl Send for ScalarType
impl Sync for ScalarType
impl Unpin for ScalarType
impl UnsafeUnpin for ScalarType
impl UnwindSafe for ScalarType
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