pub struct PytorchMetadata {
pub format_version: Option<String>,
pub format_type: FileFormat,
pub byte_order: ByteOrder,
pub has_storage_alignment: bool,
pub pytorch_version: Option<String>,
pub tensor_count: usize,
pub total_data_size: Option<usize>,
}Expand description
Metadata about a PyTorch file
Contains information about the file format, version, and other properties that can be useful for debugging or compatibility checking.
Fields§
§format_version: Option<String>Format version (e.g., “1.0” for modern ZIP format)
format_type: FileFormatFile format type (ZIP, Legacy, or Pickle)
byte_order: ByteOrderByte order (endianness) - currently only LittleEndian is supported
has_storage_alignment: boolWhether the file has storage alignment information
pytorch_version: Option<String>PyTorch version that saved the file (if available)
tensor_count: usizeNumber of tensors in the file
total_data_size: Option<usize>Total size of tensor data in bytes (if available)
Implementations§
Source§impl PytorchMetadata
impl PytorchMetadata
Sourcepub fn is_modern_format(&self) -> bool
pub fn is_modern_format(&self) -> bool
Check if this is a modern format file (ZIP-based, PyTorch 1.6+)
Sourcepub fn is_legacy_format(&self) -> bool
pub fn is_legacy_format(&self) -> bool
Check if this is a legacy format file (PyTorch 0.1.10 - 1.5)
Trait Implementations§
Source§impl Clone for PytorchMetadata
impl Clone for PytorchMetadata
Source§fn clone(&self) -> PytorchMetadata
fn clone(&self) -> PytorchMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PytorchMetadata
impl RefUnwindSafe for PytorchMetadata
impl Send for PytorchMetadata
impl Sync for PytorchMetadata
impl Unpin for PytorchMetadata
impl UnwindSafe for PytorchMetadata
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