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>Contents of the .format_version entry (e.g. "1"), if the archive has one
format_type: FileFormatFile format type (ZIP, TAR, Legacy, or Pickle)
byte_order: ByteOrderByte order. Always LittleEndian: big-endian files are rejected at load.
has_storage_alignment: boolWhether the file has storage alignment information
pytorch_version: Option<String>Contents of the version entry (e.g. "3"): the serialized-file format version,
not the PyTorch release that wrote the file
tensor_count: usizeNumber of tensors in the file
total_data_size: Option<usize>Approximate size of the storage section 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
Auto Trait Implementations§
impl Freeze for PytorchMetadata
impl RefUnwindSafe for PytorchMetadata
impl Send for PytorchMetadata
impl Sync for PytorchMetadata
impl Unpin for PytorchMetadata
impl UnsafeUnpin 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