pub struct Model { /* private fields */ }Expand description
Compiled Neuron model, loaded from a NEFF binary onto one or more NeuronCores.
Implementations§
Source§impl Model
impl Model
Sourcepub fn load(
neff: &[u8],
start_nc: i32,
nc_count: i32,
) -> Result<Self, NeuronError>
pub fn load( neff: &[u8], start_nc: i32, nc_count: i32, ) -> Result<Self, NeuronError>
Load neff onto NeuronCores [start_nc, start_nc + nc_count).
nc_count = 1 is the typical case for a single-core inference
model; multi-core is used for tensor-parallel Trn1/Trn2 graphs.
Sourcepub fn execute(
&self,
inputs: &TensorSet,
outputs: &TensorSet,
) -> Result<(), NeuronError>
pub fn execute( &self, inputs: &TensorSet, outputs: &TensorSet, ) -> Result<(), NeuronError>
Execute this model with pre-populated input / output tensor sets. Blocks until the NeuronCore signals completion.
pub fn raw(&self) -> NrtModelHandle
Trait Implementations§
Auto Trait Implementations§
impl !Send for Model
impl !Sync for Model
impl Freeze for Model
impl RefUnwindSafe for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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