#[non_exhaustive]pub enum CollateError {
EmptyBatch,
ConversionBatchSize {
actual: usize,
},
SequenceLengthMismatch {
sample: usize,
expected: usize,
actual: usize,
},
OptionPresenceMismatch {
sample: usize,
expected_some: bool,
actual_some: bool,
},
MapKeysMismatch {
sample: usize,
},
SizeOverflow {
context: &'static str,
value: usize,
},
Allocation {
context: &'static str,
requested: usize,
source: TryReserveError,
},
LibTorch {
source: RustTorchError,
},
}Expand description
An error produced by built-in collation or conversion.
The DefaultCollator and DefaultConverter examples show the public
operations that return this error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
EmptyBatch
A collator received no top-level samples.
ConversionBatchSize
A no-batching converter received other than one sample.
SequenceLengthMismatch
One sequence had a different length from the first sample.
Fields
OptionPresenceMismatch
One option had different presence from the first sample.
Fields
MapKeysMismatch
One map had a different ordered key set from the first sample.
SizeOverflow
A caller-controlled size cannot be represented by the native API.
Fields
Allocation
A required intermediate allocation could not be reserved.
Fields
§
source: TryReserveErrorStandard-library allocation error.
LibTorch
LibTorch rejected tensor construction or stacking.
Fields
§
source: RustTorchErrorPreserved backend error and source chain.
Trait Implementations§
Source§impl Debug for CollateError
impl Debug for CollateError
Source§impl Display for CollateError
impl Display for CollateError
Source§impl Error for CollateError
impl Error for CollateError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<!> for CollateError
impl From<!> for CollateError
Source§fn from(error: Infallible) -> Self
fn from(error: Infallible) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for CollateError
impl !UnwindSafe for CollateError
impl Forget for CollateError
impl Freeze for CollateError
impl Send for CollateError
impl Sync for CollateError
impl Unpin for CollateError
impl UnsafeUnpin for CollateError
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