pub struct TensorData {
pub name: Option<String>,
pub dtype: DataType,
pub dims: Vec<usize>,
pub data: Vec<u8>,
pub strings: Vec<String>,
}Expand description
A concrete constant tensor held inline (e.g. an attribute value or a small initializer). Element bytes are stored little-endian and densely packed.
Large model weights are referenced lazily via WeightRef instead.
Fields§
§name: Option<String>§dtype: DataType§dims: Vec<usize>Static dimensions (constants always have a fully known shape).
data: Vec<u8>Raw little-endian element bytes. Sub-byte values are densely packed
(two 4-bit or four 2-bit elements per byte); for DataType::String
this is empty and strings is used instead.
strings: Vec<String>String payloads for DataType::String tensors.
Implementations§
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 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 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