#[repr(u32)]pub enum Dtype {
Show 14 variants
Bool = 0,
Uint8 = 1,
Uint16 = 2,
Uint32 = 3,
Uint64 = 4,
Int8 = 5,
Int16 = 6,
Int32 = 7,
Int64 = 8,
Float16 = 9,
Float32 = 10,
Float64 = 11,
Bfloat16 = 12,
Complex64 = 13,
}
Expand description
Array element type
Variants§
Bool = 0
bool
Uint8 = 1
u8
Uint16 = 2
u16
Uint32 = 3
u32
Uint64 = 4
u64
Int8 = 5
i8
Int16 = 6
i16
Int32 = 7
i32
Int64 = 8
i64
Float16 = 9
f16
Float32 = 10
f32
Float64 = 11
f64
Bfloat16 = 12
bfloat16
Complex64 = 13
complex64
Implementations§
Source§impl Dtype
impl Dtype
Sourcepub fn is_complex(&self) -> bool
pub fn is_complex(&self) -> bool
Returns true
if the data type is complex.
Sourcepub fn is_inexact(&self) -> bool
pub fn is_inexact(&self) -> bool
Returns true
if the data type is one of f16
, f32
, bfloat16
, or complex64
.
Sourcepub fn from_promoting_types(a: Dtype, b: Dtype) -> Self
pub fn from_promoting_types(a: Dtype, b: Dtype) -> Self
Returns the promotion type of two data types.
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 moreSource§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Convert into an
Option
.