pub struct PyTorchLoadOptions {
pub device: Device,
pub dtype: Option<DType>,
pub allow_legacy_format: bool,
pub weights_only: bool,
pub max_file_size: Option<usize>,
pub progress_callback: Option<Box<dyn Fn(ProgressEvent) + Send + Sync>>,
}Available on crate feature
pytorch only.Expand description
Options for loading PyTorch files
Fields§
§device: DeviceTarget device for tensor loading
dtype: Option<DType>Target dtype for tensor conversion
allow_legacy_format: boolWhether to attempt loading legacy pickle formats
weights_only: boolWhether to load only tensor data (safer)
max_file_size: Option<usize>Maximum file size to prevent memory exhaustion (in bytes)
progress_callback: Option<Box<dyn Fn(ProgressEvent) + Send + Sync>>Progress callback
Trait Implementations§
Source§impl Clone for PyTorchLoadOptions
impl Clone for PyTorchLoadOptions
Source§impl Debug for PyTorchLoadOptions
impl Debug for PyTorchLoadOptions
Source§impl Default for PyTorchLoadOptions
impl Default for PyTorchLoadOptions
Source§impl From<&LoadOptions> for PyTorchLoadOptions
impl From<&LoadOptions> for PyTorchLoadOptions
Source§fn from(opts: &LoadOptions) -> Self
fn from(opts: &LoadOptions) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for PyTorchLoadOptions
impl !UnwindSafe for PyTorchLoadOptions
impl Freeze for PyTorchLoadOptions
impl Send for PyTorchLoadOptions
impl Sync for PyTorchLoadOptions
impl Unpin for PyTorchLoadOptions
impl UnsafeUnpin for PyTorchLoadOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more