Struct candle_core::npy::NpzTensors
source · pub struct NpzTensors { /* private fields */ }
Expand description
Lazy tensor loader.
Implementations§
source§impl NpzTensors
impl NpzTensors
pub fn new<T: AsRef<Path>>(path: T) -> Result<Self>
pub fn names(&self) -> Vec<&String>
sourcepub fn get_shape_and_dtype(&self, name: &str) -> Result<(Shape, DType)>
pub fn get_shape_and_dtype(&self, name: &str) -> Result<(Shape, DType)>
This only returns the shape and dtype for a named tensor. Compared to get
, this avoids
reading the whole tensor data.
pub fn get(&self, name: &str) -> Result<Option<Tensor>>
Auto Trait Implementations§
impl Freeze for NpzTensors
impl RefUnwindSafe for NpzTensors
impl Send for NpzTensors
impl Sync for NpzTensors
impl Unpin for NpzTensors
impl UnwindSafe for NpzTensors
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