pub struct Session<'a> {
pub inputs: Vec<Input>,
pub outputs: Vec<Output>,
/* private fields */
}
Expand description
Type storing the session information, built from an Environment
Fields§
§inputs: Vec<Input>
Information about the ONNX’s inputs as stored in loaded file
outputs: Vec<Output>
Information about the ONNX’s outputs as stored in loaded file
Implementations§
Source§impl<'a> Session<'a>
impl<'a> Session<'a>
Sourcepub fn run<'s, 't, 'm, TIn, TOut, D>(
&'s mut self,
input_arrays: Vec<Array<TIn, D>>,
) -> Result<Vec<OrtOwnedTensor<'t, 'm, TOut, IxDyn>>>where
TIn: TypeToTensorElementDataType + Debug + Clone,
TOut: TypeToTensorElementDataType + Debug + Clone,
D: Dimension,
'm: 't,
's: 'm,
pub fn run<'s, 't, 'm, TIn, TOut, D>(
&'s mut self,
input_arrays: Vec<Array<TIn, D>>,
) -> Result<Vec<OrtOwnedTensor<'t, 'm, TOut, IxDyn>>>where
TIn: TypeToTensorElementDataType + Debug + Clone,
TOut: TypeToTensorElementDataType + Debug + Clone,
D: Dimension,
'm: 't,
's: 'm,
Run the input data through the ONNX graph, performing inference.
Note that ONNX models can have multiple inputs; a Vec<_>
is thus
used for the input data here.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Session<'a>
impl<'a> RefUnwindSafe for Session<'a>
impl<'a> !Send for Session<'a>
impl<'a> !Sync for Session<'a>
impl<'a> Unpin for Session<'a>
impl<'a> UnwindSafe for Session<'a>
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