pub struct AprReader {
pub metadata: AprMetadata,
pub tensors: Vec<AprTensorDescriptor>,
/* private fields */
}Expand description
APR format reader
Fields§
§metadata: AprMetadataParsed metadata
tensors: Vec<AprTensorDescriptor>Tensor descriptors
Implementations§
Source§impl AprReader
impl AprReader
Sourcepub fn from_bytes(data: Vec<u8>) -> Result<Self, String>
pub fn from_bytes(data: Vec<u8>) -> Result<Self, String>
Parse APR format from bytes
Automatically detects APR1 (uncompressed) or APR2 (compressed) format.
§Errors
Returns error if format is invalid
Sourcepub fn get_metadata(&self, key: &str) -> Option<&JsonValue>
pub fn get_metadata(&self, key: &str) -> Option<&JsonValue>
Get metadata value by key
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AprReader
impl RefUnwindSafe for AprReader
impl Send for AprReader
impl Sync for AprReader
impl Unpin for AprReader
impl UnsafeUnpin for AprReader
impl UnwindSafe for AprReader
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> 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