pub enum BinTensorError {
Show 14 variants
InvalidHeader,
HeaderTooLarge,
HeaderTooSmall,
InvalidHeaderLength,
TensorNotFound(String),
TensorInvalidInfo,
InvalidOffset(String),
IoError(Error),
EncodeError(EncodeError),
DecoderError(DecodeError),
InvalidTensorView(Dtype, Vec<usize>, usize),
MetadataIncompleteBuffer,
ValidationOverflow,
ValidationMismatch,
}
Expand description
Possible errors that could occur while reading A Bintensor file.
Variants§
InvalidHeader
The header is an invalid UTF-8 string and cannot be read.
HeaderTooLarge
The header is large than 100Mo which is considered too large (Might evolve in the future).
HeaderTooSmall
The header is smaller than 8 bytes
InvalidHeaderLength
The header length is invalid
TensorNotFound(String)
The tensor name was not found in the archive
TensorInvalidInfo
Invalid information between shape, dtype and the proposed offsets in the file
InvalidOffset(String)
The offsets declared for tensor with name String
in the header are invalid
IoError(Error)
IoError
EncodeError(EncodeError)
bincode encoder error
DecoderError(DecodeError)
bincode decoder error
InvalidTensorView(Dtype, Vec<usize>, usize)
The follow tensor cannot be created because the buffer size doesn’t match shape + dtype
MetadataIncompleteBuffer
The metadata is invalid because the data offsets of the tensor does not fully cover the buffer part of the file. The last offset must be the end of the file.
ValidationOverflow
The metadata contains information (shape or shape * dtype size) which lead to an arithmetic overflow. This is most likely an error in the file.
ValidationMismatch
The metadata contains a mismatch between the index map and tensor info,
leading to unnecessary memory allocation. This is likely due to file tampering.
Trait Implementations§
Source§impl Debug for BinTensorError
impl Debug for BinTensorError
Source§impl Display for BinTensorError
impl Display for BinTensorError
Source§impl Error for BinTensorError
Available on crate feature std
only.
impl Error for BinTensorError
std
only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<DecodeError> for BinTensorError
impl From<DecodeError> for BinTensorError
Source§fn from(error: DecodeError) -> BinTensorError
fn from(error: DecodeError) -> BinTensorError
Source§impl From<EncodeError> for BinTensorError
impl From<EncodeError> for BinTensorError
Source§fn from(error: EncodeError) -> BinTensorError
fn from(error: EncodeError) -> BinTensorError
Source§impl From<Error> for BinTensorError
Available on crate feature std
only.
impl From<Error> for BinTensorError
std
only.