pub struct SingleBatchOutput<'r, 's> {
pub session_outputs: SessionOutputs<'r, 's>,
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§
§session_outputs: SessionOutputs<'r, 's>
§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<'r, 's> Freeze for SingleBatchOutput<'r, 's>
impl<'r, 's> !RefUnwindSafe for SingleBatchOutput<'r, 's>
impl<'r, 's> Send for SingleBatchOutput<'r, 's>
impl<'r, 's> !Sync for SingleBatchOutput<'r, 's>
impl<'r, 's> Unpin for SingleBatchOutput<'r, 's>
impl<'r, 's> !UnwindSafe for SingleBatchOutput<'r, 's>
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> 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