pub trait OnnxInterface: Debug {
type InferenceModel: InferenceModelInterface;
// Required methods
fn load_with_options(
&self,
path: impl AsRef<Path>,
options: impl Into<OnnxOptionsSpec>,
) -> Result<Self::InferenceModel>;
fn load_buffer_with_options(
&self,
data: &[u8],
options: impl Into<OnnxOptionsSpec>,
) -> Result<Self::InferenceModel>;
// Provided methods
fn load(&self, path: impl AsRef<Path>) -> Result<Self::InferenceModel> { ... }
fn load_buffer(&self, data: &[u8]) -> Result<Self::InferenceModel> { ... }
}Required Associated Types§
Required Methods§
Sourcefn load_with_options(
&self,
path: impl AsRef<Path>,
options: impl Into<OnnxOptionsSpec>,
) -> Result<Self::InferenceModel>
fn load_with_options( &self, path: impl AsRef<Path>, options: impl Into<OnnxOptionsSpec>, ) -> Result<Self::InferenceModel>
Load a ONNX model from a file, configuring the loader with options.
options is either an OnnxOptions or the JSON for one.
Sourcefn load_buffer_with_options(
&self,
data: &[u8],
options: impl Into<OnnxOptionsSpec>,
) -> Result<Self::InferenceModel>
fn load_buffer_with_options( &self, data: &[u8], options: impl Into<OnnxOptionsSpec>, ) -> Result<Self::InferenceModel>
Load a ONNX model from a buffer, configuring the loader with options.
Provided Methods§
Sourcefn load(&self, path: impl AsRef<Path>) -> Result<Self::InferenceModel>
fn load(&self, path: impl AsRef<Path>) -> Result<Self::InferenceModel>
Load a ONNX model from a file into an InferenceModel.
Sourcefn load_buffer(&self, data: &[u8]) -> Result<Self::InferenceModel>
fn load_buffer(&self, data: &[u8]) -> Result<Self::InferenceModel>
Load a ONNX model from a buffer into an InferenceModel.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".