Enum re_components::TensorData
source · pub enum TensorData {
U8(Buffer<u8>),
U16(Buffer<u16>),
U32(Buffer<u32>),
U64(Buffer<u64>),
I8(Buffer<i8>),
I16(Buffer<i16>),
I32(Buffer<i32>),
I64(Buffer<i64>),
F16(Buffer<f16>),
F32(Buffer<f32>),
F64(Buffer<f64>),
JPEG(Buffer<u8>),
}
Expand description
Flattened Tensor
data payload
Examples
assert_eq!(
TensorData::data_type(),
DataType::Union(
vec![
Field::new("U8", DataType::Binary, false),
Field::new(
"U16",
DataType::List(Box::new(Field::new("item", DataType::UInt16, false))),
false
),
Field::new(
"U32",
DataType::List(Box::new(Field::new("item", DataType::UInt32, false))),
false
),
Field::new(
"U64",
DataType::List(Box::new(Field::new("item", DataType::UInt64, false))),
false
),
Field::new(
"I8",
DataType::List(Box::new(Field::new("item", DataType::Int8, false))),
false
),
Field::new(
"I16",
DataType::List(Box::new(Field::new("item", DataType::Int16, false))),
false
),
Field::new(
"I32",
DataType::List(Box::new(Field::new("item", DataType::Int32, false))),
false
),
Field::new(
"I64",
DataType::List(Box::new(Field::new("item", DataType::Int64, false))),
false
),
Field::new(
"F16",
DataType::List(Box::new(Field::new("item", DataType::Float16, false))),
false
),
Field::new(
"F32",
DataType::List(Box::new(Field::new("item", DataType::Float32, false))),
false
),
Field::new(
"F64",
DataType::List(Box::new(Field::new("item", DataType::Float64, false))),
false
),
Field::new("JPEG", DataType::Binary, false),
],
None,
UnionMode::Dense
),
);
Variants§
U8(Buffer<u8>)
U16(Buffer<u16>)
U32(Buffer<u32>)
U64(Buffer<u64>)
I8(Buffer<i8>)
I16(Buffer<i16>)
I32(Buffer<i32>)
I64(Buffer<i64>)
F16(Buffer<f16>)
F32(Buffer<f32>)
F64(Buffer<f64>)
JPEG(Buffer<u8>)
Implementations§
source§impl TensorData
impl TensorData
pub fn dtype(&self) -> TensorDataType
pub fn size_in_bytes(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_compressed_image(&self) -> bool
Trait Implementations§
source§impl ArrowDeserialize for TensorData
impl ArrowDeserialize for TensorData
source§impl ArrowField for TensorData
impl ArrowField for TensorData
source§impl ArrowSerialize for TensorData
impl ArrowSerialize for TensorData
§type MutableArrayType = MutableTensorDataArray
type MutableArrayType = MutableTensorDataArray
The
arrow2::array::MutableArray
that holds this valuesource§fn new_array() -> Self::MutableArrayType
fn new_array() -> Self::MutableArrayType
Create a new mutable array
source§fn arrow_serialize(v: &Self, array: &mut Self::MutableArrayType) -> Result<()>
fn arrow_serialize(v: &Self, array: &mut Self::MutableArrayType) -> Result<()>
Serialize this field to arrow
source§impl Clone for TensorData
impl Clone for TensorData
source§fn clone(&self) -> TensorData
fn clone(&self) -> TensorData
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TensorData
impl Debug for TensorData
source§impl PartialEq<TensorData> for TensorData
impl PartialEq<TensorData> for TensorData
source§fn eq(&self, other: &TensorData) -> bool
fn eq(&self, other: &TensorData) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for TensorData
Auto Trait Implementations§
impl RefUnwindSafe for TensorData
impl Send for TensorData
impl Sync for TensorData
impl Unpin for TensorData
impl UnwindSafe for TensorData
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
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>,
Casts the value.
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>
Casts the value.
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<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere Dst: LosslessTryFrom<Src>,
source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere Dst: LossyFrom<Src>,
source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.