pub struct AnyTensor {
pub bytes: Vec<u8>,
pub dtype: Dtype,
pub shape: Vec<usize>,
}Expand description
Concrete-erased tensor. Stores raw bytes plus a runtime-known
dtype + shape. Compute-outsourcing concretes (an index that
delegates distance math to a bound Backend) declare
type Vector = AnyTensor — Storage::TYPE = &TYPE_TENSOR puts
the value at a non-leaf position in the tree, so any tensor
subtype unifies into it.
Fields§
§bytes: Vec<u8>Raw little-endian bytes of the tensor payload, packed per dtype.
dtype: DtypeRuntime dtype. Pair with Self::shape for full interpretation.
shape: Vec<usize>Per-axis shape. shape.iter().product::<usize>() × dtype-size
is expected to equal bytes.len().
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AnyTensor
impl RefUnwindSafe for AnyTensor
impl Send for AnyTensor
impl Sync for AnyTensor
impl Unpin for AnyTensor
impl UnsafeUnpin for AnyTensor
impl UnwindSafe for AnyTensor
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