Enum rerun::external::re_types::tensor_data::TensorElement
source · pub enum TensorElement {
U8(u8),
U16(u16),
U32(u32),
U64(u64),
I8(i8),
I16(i16),
I32(i32),
I64(i64),
F16(f16),
F32(f32),
F64(f64),
}
Expand description
The data that can be stored in a crate::datatypes::TensorData
.
Variants§
U8(u8)
Unsigned 8 bit integer.
Commonly used for sRGB(A).
U16(u16)
Unsigned 16 bit integer.
Used by some depth images and some high-bitrate images.
U32(u32)
Unsigned 32 bit integer.
U64(u64)
Unsigned 64 bit integer.
I8(i8)
Signed 8 bit integer.
I16(i16)
Signed 16 bit integer.
I32(i32)
Signed 32 bit integer.
I64(i64)
Signed 64 bit integer.
F16(f16)
16-bit floating point number.
Uses the standard IEEE 754-2008 binary16 format. Set https://en.wikipedia.org/wiki/Half-precision_floating-point_format.
F32(f32)
32-bit floating point number.
F64(f64)
64-bit floating point number.
Implementations§
source§impl TensorElement
impl TensorElement
sourcepub fn as_f64(&self) -> f64
pub fn as_f64(&self) -> f64
Get the value as a 64-bit floating point number.
Note that this may cause rounding for large 64-bit integers,
as f64
can only represent integers up to 2^53 exactly.
sourcepub fn try_as_u16(&self) -> Option<u16>
pub fn try_as_u16(&self) -> Option<u16>
Convert the value to a u16
, but only if it can be represented
exactly as a u16
, without any rounding or clamping.
Trait Implementations§
source§impl Clone for TensorElement
impl Clone for TensorElement
source§fn clone(&self) -> TensorElement
fn clone(&self) -> TensorElement
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TensorElement
impl Debug for TensorElement
source§impl Display for TensorElement
impl Display for TensorElement
source§impl PartialEq for TensorElement
impl PartialEq for TensorElement
source§fn eq(&self, other: &TensorElement) -> bool
fn eq(&self, other: &TensorElement) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for TensorElement
impl StructuralPartialEq for TensorElement
Auto Trait Implementations§
impl Freeze for TensorElement
impl RefUnwindSafe for TensorElement
impl Send for TensorElement
impl Sync for TensorElement
impl Unpin for TensorElement
impl UnwindSafe for TensorElement
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> 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> ⓘ
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> ⓘ
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