pub struct TensorInfo {
pub name: String,
pub dtype: TensorDType,
pub native_dtype: String,
pub shape: TensorShape,
pub byte_len: usize,
pub location: TensorLocation,
}Expand description
Format-independent description of one tensor.
Fields§
§name: StringExact tensor name.
dtype: TensorDTypeNormalized dtype.
native_dtype: StringDtype label exactly as the source format names it
(Safetensors header string, or GGUF ggml_type_label).
shape: TensorShapeOutermost-first shape (native order recoverable).
byte_len: usizeRaw payload length in bytes (packed length for packed dtypes).
location: TensorLocationPayload location.
Implementations§
Source§impl TensorInfo
impl TensorInfo
Sourcepub fn new(
name: impl Into<String>,
dtype: TensorDType,
shape: TensorShape,
byte_len: usize,
location: TensorLocation,
) -> Self
pub fn new( name: impl Into<String>, dtype: TensorDType, shape: TensorShape, byte_len: usize, location: TensorLocation, ) -> Self
Build a tensor description, e.g. for mock inventories in downstream
tests. native_dtype defaults to TensorDType::label.
Sourcepub fn with_native_dtype(self, native_dtype: impl Into<String>) -> Self
pub fn with_native_dtype(self, native_dtype: impl Into<String>) -> Self
Override the native dtype label.
Trait Implementations§
Source§impl Clone for TensorInfo
impl Clone for TensorInfo
Source§impl Debug for TensorInfo
impl Debug for TensorInfo
impl Eq for TensorInfo
Source§impl Hash for TensorInfo
impl Hash for TensorInfo
Source§impl PartialEq for TensorInfo
impl PartialEq for TensorInfo
impl StructuralPartialEq for TensorInfo
Auto Trait Implementations§
impl Forget for TensorInfo
impl Freeze for TensorInfo
impl Move for TensorInfo
impl RefUnwindSafe for TensorInfo
impl Send for TensorInfowhere
RawVecInner: Send,
impl Sync for TensorInfowhere
RawVecInner: Sync,
impl Unpin for TensorInfo
impl UnsafeUnpin for TensorInfowhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
impl UnwindSafe for TensorInfowhere
RawVecInner: UnwindSafe,
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