pub struct Tensor {
pub name: String,
pub dtype: DType,
pub shape: Shape,
pub param_id: Option<u64>,
pub bytes: Bytes,
}Expand description
A single tensor in a burnpack container, decoupled from any tensor library.
The bytes field holds the tensor’s data in little-endian layout,
matching the element count implied by shape and dtype.
When produced by a Reader loading from a file, the bytes are
file-backed and only read from disk when accessed.
Fields§
§name: StringFully-qualified tensor name (e.g. "encoder.layer1.weight").
dtype: DTypeData type of the tensor.
shape: ShapeTensor shape.
param_id: Option<u64>Optional parameter id, used to preserve identities for stateful training.
bytes: BytesThe tensor’s raw little-endian bytes.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Tensor
impl !UnwindSafe for Tensor
impl Freeze for Tensor
impl Send for Tensor
impl Sync for Tensor
impl Unpin for Tensor
impl UnsafeUnpin for Tensor
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