pub enum Error {
Io(Error),
Cuda {
call: &'static str,
code: i32,
message: String,
},
TensorRt {
call: &'static str,
message: String,
},
UnknownTensor {
name: String,
available: Vec<String>,
},
UnsupportedDataType {
tensor: String,
code: i32,
},
DynamicShape {
tensor: String,
shape: Vec<i64>,
},
SizeMismatch {
tensor: String,
expected: usize,
found: usize,
},
TooManyDimensions {
found: usize,
max: usize,
},
InvalidTensorName(String),
}Expand description
Everything this crate can fail at, carrying the TensorRT or CUDA diagnostic when there is one.
Variants§
Io(Error)
Reading the engine file failed.
Cuda
A CUDA runtime call returned an error code.
Fields
TensorRt
A TensorRT call returned false, or the runtime refused the engine.
Fields
UnknownTensor
No tensor with that name exists in the engine.
Fields
UnsupportedDataType
The engine uses an element type this crate cannot compute a size for.
DynamicShape
A tensor has dynamic dimensions, so its size is unknown until a shape is set.
Fields
SizeMismatch
A buffer and the tensor it was bound to hold different numbers of bytes.
Fields
TooManyDimensions
A shape has more dimensions than TensorRT allows.
InvalidTensorName(String)
A tensor name contains an embedded NUL and cannot reach the C API.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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