#[repr(i32)]pub enum DType {
Show 13 variants
Unspecified = 0,
Bool = 1,
Uint8 = 2,
Uint16 = 3,
Uint32 = 4,
Uint64 = 5,
Int8 = 6,
Int16 = 7,
Int32 = 8,
Int64 = 9,
Float16 = 10,
Float32 = 11,
Float64 = 12,
}Expand description
Element data type for tensor values exchanged across the wire.
Discriminants are kept byte-identical to the rlmesh.spaces.v1.DType proto
enum. The equality is enforced at compile time by a cross-check in
rlmesh-grpc (wire::spaces); rlmesh-spaces stays free of a
rlmesh-proto dependency, so the assert cannot live here.
Variants§
Unspecified = 0
Bool = 1
Uint8 = 2
Uint16 = 3
Uint32 = 4
Uint64 = 5
Int8 = 6
Int16 = 7
Int32 = 8
Int64 = 9
Float16 = 10
Float32 = 11
Float64 = 12
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<DType>
pub fn from_name(name: &str) -> Option<DType>
Parse a canonical dtype name. Only the 12 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request