pub enum DType {
F16,
F32,
F64,
I8,
I16,
I32,
I64,
U8,
U32,
U64,
Bool,
}Expand description
Runtime representation of tensor data types.
Variants§
F16
16-bit floating point (half precision).
F32
32-bit floating point (single precision).
F64
64-bit floating point (double precision).
I8
8-bit signed integer.
I16
16-bit signed integer.
I32
32-bit signed integer.
I64
64-bit signed integer.
U8
8-bit unsigned integer.
U32
32-bit unsigned integer.
U64
64-bit unsigned integer.
Bool
Boolean type.
Implementations§
Source§impl DType
impl DType
Sourcepub const fn is_integer(self) -> bool
pub const fn is_integer(self) -> bool
Returns true if this is an integer type.
Sourcepub const fn default_float() -> DType
pub const fn default_float() -> DType
Returns the default floating point type (f32).
Sourcepub const fn default_int() -> DType
pub const fn default_int() -> DType
Returns the default integer type (i64).
Trait Implementations§
impl Copy for DType
impl Eq 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more