pub struct TensorEntry {
pub name: String,
pub dtype: DType,
pub shape: Shape,
/* private fields */
}Expand description
One tensor’s identity and location, without its bytes.
Deliberately does not hold a &[u8] or a Vec<u8> directly. Doing so
would tie every TensorEntry to the lifetime of (or force a copy out
of) the LoadedModel that owns the backing storage, for no benefit —
nothing in this crate ever needs a tensor’s bytes without also having
the LoadedModel at hand. Storing an offset and length instead, and
serving bytes through LoadedModel::tensor_bytes, keeps TensorEntry
cheap to clone and keeps the bounds check in exactly one place
(ByteSource::slice).
Fields§
§name: StringThe tensor’s name as it appears in the file, e.g. "blk.0.attn_q.weight".
dtype: DType§shape: ShapeDimensions in kopitiam_core::Shape’s convention: outermost
first, row-major, last dimension contiguous. See the crate-level
docs and [crate::gguf] for why GGUF’s on-disk dimension order has
to be reversed to produce this.
Trait Implementations§
Source§impl Clone for TensorEntry
impl Clone for TensorEntry
Source§fn clone(&self) -> TensorEntry
fn clone(&self) -> TensorEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more