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
Source§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 for TensorData
impl PartialEq for TensorData
impl StructuralPartialEq for TensorData
Auto Trait Implementations§
impl Freeze for TensorData
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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<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.
Source§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>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
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.