pub struct CompiledModel { /* private fields */ }Expand description
A compiled model that can be used to run inference.
Implementations§
Source§impl CompiledModel
impl CompiledModel
Sourcepub fn create(
environment: &Environment,
model: &Model,
options: &Options,
) -> Result<Self, Error>
pub fn create( environment: &Environment, model: &Model, options: &Options, ) -> Result<Self, Error>
Creates a new compiled model.
Sourcepub fn create_input_tensor_buffers(
&self,
environment: &Environment,
model: &Model,
signature_index: usize,
) -> Result<Vec<TensorBuffer<'_>>, Error>
pub fn create_input_tensor_buffers( &self, environment: &Environment, model: &Model, signature_index: usize, ) -> Result<Vec<TensorBuffer<'_>>, Error>
Creates a set of input tensor buffers for the specified signature.
Sourcepub fn create_output_tensor_buffers(
&self,
environment: &Environment,
model: &Model,
signature_index: usize,
) -> Result<Vec<TensorBuffer<'_>>, Error>
pub fn create_output_tensor_buffers( &self, environment: &Environment, model: &Model, signature_index: usize, ) -> Result<Vec<TensorBuffer<'_>>, Error>
Creates a set of output tensor buffers for the specified signature.
Sourcepub fn run(
&self,
signature_index: usize,
input: &[TensorBuffer<'_>],
output: &[TensorBuffer<'_>],
) -> Result<(), Error>
pub fn run( &self, signature_index: usize, input: &[TensorBuffer<'_>], output: &[TensorBuffer<'_>], ) -> Result<(), Error>
Runs inference on the compiled model.
Auto Trait Implementations§
impl Freeze for CompiledModel
impl RefUnwindSafe for CompiledModel
impl !Send for CompiledModel
impl !Sync for CompiledModel
impl Unpin for CompiledModel
impl UnsafeUnpin for CompiledModel
impl UnwindSafe for CompiledModel
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