pub struct SingleBatchOutput {
pub outputs: Vec<(String, Value)>,
pub attention_mask_array: Array2<i64>,
}
Expand description
SingleBatchOutput
contains the output of a single batch of inference.
In the future, each batch will need to deal with its own post-processing, such as pooling etc. This struct should contain all the necessary information for the post-processing to be performed.
Fields§
§outputs: Vec<(String, Value)>
§attention_mask_array: Array2<i64>
Implementations§
Source§impl SingleBatchOutput
impl SingleBatchOutput
Sourcepub fn select_output(
&self,
precedence: &impl OutputPrecedence,
) -> Result<ArrayView<'_, f32, Dim<IxDynImpl>>>
pub fn select_output( &self, precedence: &impl OutputPrecedence, ) -> Result<ArrayView<'_, f32, Dim<IxDynImpl>>>
Select the output from the session outputs based on the given precedence.
This returns a view into the tensor, which can be used to perform further operations.
Sourcepub fn select_and_pool_output(
&self,
precedence: &impl OutputPrecedence,
pooling_opt: Option<Pooling>,
) -> Result<Array2<f32>>
pub fn select_and_pool_output( &self, precedence: &impl OutputPrecedence, pooling_opt: Option<Pooling>, ) -> Result<Array2<f32>>
Select the output from the session outputs based on the given precedence and pool it.
This function will pool the output based on the given pooling option, if any.
Auto Trait Implementations§
impl Freeze for SingleBatchOutput
impl !RefUnwindSafe for SingleBatchOutput
impl Send for SingleBatchOutput
impl Sync for SingleBatchOutput
impl Unpin for SingleBatchOutput
impl !UnwindSafe for SingleBatchOutput
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