#[repr(i32)]pub enum DType {
Show 14 variants
Unspecified = 0,
Bool = 1,
Uint8 = 2,
Int32 = 3,
Int64 = 4,
Float16 = 5,
Float32 = 6,
Float64 = 7,
Int8 = 8,
Int16 = 9,
Uint16 = 10,
Uint32 = 11,
Uint64 = 12,
Bfloat16 = 13,
}Expand description
Element data type for tensor values exchanged across the wire.
Discriminants match the rlmesh.spaces.v1.DType proto enum.
Variants§
Unspecified = 0
Bool = 1
Uint8 = 2
Int32 = 3
Int64 = 4
Float16 = 5
Float32 = 6
Float64 = 7
Int8 = 8
Int16 = 9
Uint16 = 10
Uint32 = 11
Uint64 = 12
Bfloat16 = 13
Implementations§
Source§impl DType
impl DType
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
The canonical lowercase dtype name (for example "float32").
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Parse a canonical dtype name. Only the 13 concrete dtypes are
recognized; "unspecified" and unknown names return None.
Sourcepub const fn is_integer(self) -> bool
pub const fn is_integer(self) -> bool
Whether this is an integer dtype (signed or unsigned). Bool and the
float dtypes are not integers.
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 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