Enum rerun::datatypes::TensorBuffer
source · pub enum TensorBuffer {
Show 14 variants
U8(ArrowBuffer<u8>),
U16(ArrowBuffer<u16>),
U32(ArrowBuffer<u32>),
U64(ArrowBuffer<u64>),
I8(ArrowBuffer<i8>),
I16(ArrowBuffer<i16>),
I32(ArrowBuffer<i32>),
I64(ArrowBuffer<i64>),
F16(ArrowBuffer<f16>),
F32(ArrowBuffer<f32>),
F64(ArrowBuffer<f64>),
Jpeg(ArrowBuffer<u8>),
Nv12(ArrowBuffer<u8>),
Yuy2(ArrowBuffer<u8>),
}
Expand description
Datatype: The underlying storage for a Tensor
.
Tensor elements are stored in a contiguous buffer of a single type.
Variants§
U8(ArrowBuffer<u8>)
8bit unsigned integer.
U16(ArrowBuffer<u16>)
16bit unsigned integer.
U32(ArrowBuffer<u32>)
32bit unsigned integer.
U64(ArrowBuffer<u64>)
64bit unsigned integer.
I8(ArrowBuffer<i8>)
8bit signed integer.
I16(ArrowBuffer<i16>)
16bit signed integer.
I32(ArrowBuffer<i32>)
32bit signed integer.
I64(ArrowBuffer<i64>)
64bit signed integer.
F16(ArrowBuffer<f16>)
16bit IEEE-754 floating point, also known as half
.
F32(ArrowBuffer<f32>)
32bit IEEE-754 floating point, also known as float
or single
.
F64(ArrowBuffer<f64>)
64bit IEEE-754 floating point, also known as double
.
Jpeg(ArrowBuffer<u8>)
Raw bytes of a JPEG file.
Nv12(ArrowBuffer<u8>)
NV12 is a YUV 4:2:0 chroma downsamples format with 8 bits per channel.
First comes entire image in Y, followed by interleaved lines ordered as U0, V0, U1, V1, etc.
Yuy2(ArrowBuffer<u8>)
YUY2, also known as YUYV is a YUV 4:2:2 chroma downsampled format with 8 bits per channel.
The order of the channels is Y0, U0, Y1, V0.
Implementations§
source§impl TensorBuffer
impl TensorBuffer
sourcepub fn dtype(&self) -> TensorDataType
pub fn dtype(&self) -> TensorDataType
The underlying data type of the buffer.
sourcepub fn size_in_bytes(&self) -> usize
pub fn size_in_bytes(&self) -> usize
The size of the buffer in bytes.
sourcepub fn is_compressed_image(&self) -> bool
pub fn is_compressed_image(&self) -> bool
Is this tensor represented by a compressed image format (JPEG, NV12, YUY2)?
Trait Implementations§
source§impl Clone for TensorBuffer
impl Clone for TensorBuffer
source§fn clone(&self) -> TensorBuffer
fn clone(&self) -> TensorBuffer
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TensorBuffer
impl Debug for TensorBuffer
source§impl Loggable for TensorBuffer
impl Loggable for TensorBuffer
type Name = DatatypeName
source§fn name() -> <TensorBuffer as Loggable>::Name
fn name() -> <TensorBuffer as Loggable>::Name
rerun.datatypes.Vec2D
.source§fn arrow_datatype() -> DataType
fn arrow_datatype() -> DataType
arrow2::datatypes::DataType
, excluding datatype extensions.source§fn to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, TensorBuffer>>>>
) -> Result<Box<dyn Array>, SerializationError>where
TensorBuffer: Clone + 'a,
fn to_arrow_opt<'a>(
data: impl IntoIterator<Item = Option<impl Into<Cow<'a, TensorBuffer>>>>
) -> Result<Box<dyn Array>, SerializationError>where
TensorBuffer: Clone + 'a,
Loggable
, serializes them into an Arrow array.
The Arrow array’s datatype will match Loggable::arrow_field
. Read moresource§fn from_arrow_opt(
arrow_data: &(dyn Array + 'static)
) -> Result<Vec<Option<TensorBuffer>>, DeserializationError>where
TensorBuffer: Sized,
fn from_arrow_opt(
arrow_data: &(dyn Array + 'static)
) -> Result<Vec<Option<TensorBuffer>>, DeserializationError>where
TensorBuffer: Sized,
source§fn extended_arrow_datatype() -> DataType
fn extended_arrow_datatype() -> DataType
arrow2::datatypes::DataType
, including datatype extensions. Read moresource§fn arrow_field() -> Field
fn arrow_field() -> Field
arrow2::datatypes::Field
, including datatype extensions. Read moresource§fn to_arrow<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>
) -> Result<Box<dyn Array>, SerializationError>where
Self: 'a,
fn to_arrow<'a>(
data: impl IntoIterator<Item = impl Into<Cow<'a, Self>>>
) -> Result<Box<dyn Array>, SerializationError>where
Self: 'a,
Loggable
, serializes
them into an Arrow array.
The Arrow array’s datatype will match Loggable::arrow_field
. Read moresource§fn from_arrow(
data: &(dyn Array + 'static)
) -> Result<Vec<Self>, DeserializationError>
fn from_arrow( data: &(dyn Array + 'static) ) -> Result<Vec<Self>, DeserializationError>
source§impl PartialEq for TensorBuffer
impl PartialEq for TensorBuffer
source§fn eq(&self, other: &TensorBuffer) -> bool
fn eq(&self, other: &TensorBuffer) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl SizeBytes for TensorBuffer
impl SizeBytes for TensorBuffer
source§fn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
self
on the heap, in bytes.source§fn total_size_bytes(&self) -> u64
fn total_size_bytes(&self) -> u64
self
in bytes, accounting for both stack and heap space.source§fn stack_size_bytes(&self) -> u64
fn stack_size_bytes(&self) -> u64
self
on the stack, in bytes. Read moreimpl StructuralPartialEq for TensorBuffer
Auto Trait Implementations§
impl Freeze for TensorBuffer
impl RefUnwindSafe for TensorBuffer
impl Send for TensorBuffer
impl Sync for TensorBuffer
impl Unpin for TensorBuffer
impl UnwindSafe for TensorBuffer
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> 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 moresource§impl<L> LoggableBatch for L
impl<L> LoggableBatch for L
type Name = <L as Loggable>::Name
source§fn name(&self) -> <L as LoggableBatch>::Name
fn name(&self) -> <L as LoggableBatch>::Name
rerun.datatypes.Vec2D
.source§fn num_instances(&self) -> usize
fn num_instances(&self) -> usize
source§fn arrow_field(&self) -> Field
fn arrow_field(&self) -> Field
arrow2::datatypes::Field
, including datatype extensions.