Skip to main content

SafeTensorsSource

Struct SafeTensorsSource 

Source
pub struct SafeTensorsSource { /* private fields */ }
Expand description

Validated, host-owned SafeTensors source used by explicit model translators.

Implementations§

Source§

impl SafeTensorsSource

Source

pub fn open(path: &Path) -> Result<Self>

Source

pub fn names(&self) -> impl Iterator<Item = &str>

Source

pub fn shape(&self, name: &str) -> Option<&[usize]>

Source

pub fn f32_bytes(&self, name: &str) -> Result<&[u8]>

Source

pub fn metadata(&self) -> &HashMap<String, String>

Auto Trait Implementations§

§

impl Forget for SafeTensorsSource

§

impl Freeze for SafeTensorsSource

§

impl Move for SafeTensorsSource

§

impl RefUnwindSafe for SafeTensorsSource

§

impl Send for SafeTensorsSource
where RawVecInner: Send, RawTable<(String, TensorInfo)>: Send, RawTable<(String, String)>: Send,

§

impl Sync for SafeTensorsSource
where RawVecInner: Sync, RawTable<(String, TensorInfo)>: Sync, RawTable<(String, String)>: Sync,

§

impl Unpin for SafeTensorsSource
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for SafeTensorsSource

§

impl UnwindSafe for SafeTensorsSource
where RawVecInner: UnwindSafe, HashMap<String, TensorInfo>: UnwindSafe, HashMap<String, String>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.