pub enum ModelSpecificValue {
Tensor {
data: Vec<f32>,
shape: Vec<usize>,
},
IntTensor {
data: Vec<i64>,
shape: Vec<usize>,
},
UintTensor {
data: Vec<u32>,
shape: Vec<usize>,
},
Int(i64),
Float(f64),
IntVec(Vec<i64>),
UintVec(Vec<u32>),
FloatVec(Vec<f32>),
TupleVec(Vec<(u32, u32)>),
Bool(bool),
}Expand description
Model-specific output values that vary by architecture.
Different vision models require different auxiliary outputs beyond pixel_values. This enum captures the common types of such outputs.
Variants§
Tensor
A tensor with shape information (data as flat vec, shape as dims)
IntTensor
A tensor of integers (e.g., aspect_ratio_ids)
UintTensor
A tensor of unsigned integers (e.g., image_grid_thw)
Int(i64)
Simple integer value
Float(f64)
Simple float value
IntVec(Vec<i64>)
List of integers
UintVec(Vec<u32>)
List of unsigned integers
FloatVec(Vec<f32>)
List of floats
TupleVec(Vec<(u32, u32)>)
List of tuples (e.g., image sizes)
Bool(bool)
Boolean flag
Implementations§
Trait Implementations§
Source§impl Clone for ModelSpecificValue
impl Clone for ModelSpecificValue
Source§fn clone(&self) -> ModelSpecificValue
fn clone(&self) -> ModelSpecificValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ModelSpecificValue
impl RefUnwindSafe for ModelSpecificValue
impl Send for ModelSpecificValue
impl Sync for ModelSpecificValue
impl Unpin for ModelSpecificValue
impl UnsafeUnpin for ModelSpecificValue
impl UnwindSafe for ModelSpecificValue
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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