pub enum TensorData {
Raw(Bytes),
Strings(Vec<Bytes>),
F32(Vec<f32>),
F64(Vec<f64>),
I32(Vec<i32>),
I64(Vec<i64>),
U64(Vec<u64>),
}Expand description
Zero-copy owned tensor data
Variants§
Raw(Bytes)
Strings(Vec<Bytes>)
F32(Vec<f32>)
F64(Vec<f64>)
I32(Vec<i32>)
I64(Vec<i64>)
U64(Vec<u64>)
Implementations§
Source§impl TensorData
impl TensorData
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Total byte length across all variants
For Strings, returns the sum of all string element byte lengths.
If all Strings are empty, returns 0.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if data contains no elements
For Raw and numeric variants, equivalent to len() == 0.
For Strings, checks if the vector of string elements is empty.
Trait Implementations§
Source§impl Clone for TensorData
impl Clone for TensorData
Source§fn clone(&self) -> TensorData
fn clone(&self) -> TensorData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for TensorData
impl RefUnwindSafe for TensorData
impl Send for TensorData
impl Sync for TensorData
impl Unpin for TensorData
impl UnsafeUnpin 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