pub enum DType {
Show 15 variants
Bool,
I8,
I16,
I32,
I64,
U8,
U16,
U32,
U64,
F16,
BF16,
F32,
F64,
C64,
C128,
}Expand description
The element type of a value.
Variants§
Bool
bool.
I8
i8.
I16
i16.
I32
i32.
I64
i64.
U8
u8.
U16
u16.
U32
u32.
U64
u64.
F16
IEEE half precision.
BF16
bfloat16.
F32
f32.
F64
f64.
C64
A complex number made of two f32s (complex64).
C128
A complex number made of two f64s (complex128).
Implementations§
Source§impl DType
impl DType
Sourcepub fn is_complex(self) -> bool
pub fn is_complex(self) -> bool
Returns whether this is a complex type.
Sourcepub fn is_inexact(self) -> bool
pub fn is_inexact(self) -> bool
Returns whether this is a floating point or complex type (NumPy’s
inexact): the types that have derivatives.
Sourcepub fn real_dtype(self) -> DType
pub fn real_dtype(self) -> DType
The type of the real and imaginary parts of a complex type (f32
for c64), or the type itself for other types.
Sourcepub fn complex_dtype(self) -> Option<DType>
pub fn complex_dtype(self) -> Option<DType>
The complex type made of f32s or f64s, or None for other types.
Sourcepub fn size_in_bytes(self) -> usize
pub fn size_in_bytes(self) -> usize
Returns the size of an element in bytes.
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum 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