Struct cervo_runtime::Runtime

source ·
pub struct Runtime { /* private fields */ }
Expand description

The runtime wraps a multitude of inference models with batching support, and support for time-limited execution.

Implementations

Create a new empty runtime.

Add a new inferer to this runtime.

Queue the state to brain for agent, to be included in the next inference batch.

Run a single item through the specific brain. If there’s pending data for the brain, this’ll have some extra overhead for new allocations.

Executes all models with queued data.

Executes all models with queued data. Will attempt to keep total time below the provided duration, but due to noise or lack of samples might miss the deadline. See the note in the root.

Retrieve the output shapes for the provided brain.

Retrieve the input shapes for the provided brain.

Clear all models and all related data. Will error (after clearing all data) if there was queued items that are now orphaned.

Clear a model and related data. Will error (after clearing all data) if there was queued items that are now orphaned.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.