Trait tract_nnef::prelude::Framework [−][src]
pub trait Framework<ProtoModel, Model> where
ProtoModel: Debug, { pub fn proto_model_for_read(
&self,
reader: &mut dyn Read
) -> Result<ProtoModel, Error>; pub fn model_for_proto_model(
&self,
proto: &ProtoModel
) -> Result<Model, Error>; pub fn proto_model_for_path(
&self,
p: impl AsRef<Path>
) -> Result<ProtoModel, Error> { ... } pub fn model_for_read(&self, r: &mut dyn Read) -> Result<Model, Error> { ... } pub fn model_for_path(&self, p: impl AsRef<Path>) -> Result<Model, Error> { ... } }
A Framework that translate its model to tract core model.
The ProtoModel is the parsed representation of the imported model. It does not have to be Protobuf based.
Required methods
pub fn proto_model_for_read(
&self,
reader: &mut dyn Read
) -> Result<ProtoModel, Error>
[src]
&self,
reader: &mut dyn Read
) -> Result<ProtoModel, Error>
Parse a proto model from a reader.
pub fn model_for_proto_model(&self, proto: &ProtoModel) -> Result<Model, Error>
[src]
Translate a proto model into a model.
Provided methods
pub fn proto_model_for_path(
&self,
p: impl AsRef<Path>
) -> Result<ProtoModel, Error>
[src]
&self,
p: impl AsRef<Path>
) -> Result<ProtoModel, Error>
Read a proto model from a filename.
pub fn model_for_read(&self, r: &mut dyn Read) -> Result<Model, Error>
[src]
Read a model from a reader
pub fn model_for_path(&self, p: impl AsRef<Path>) -> Result<Model, Error>
[src]
Build a model from a filename.
Implementors
impl Framework<ProtoModel, Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>> for Nnef
[src]
fn model_for_path(&self, p: impl AsRef<Path>) -> TractResult<TypedModel>
[src]
fn proto_model_for_path(
&self,
path: impl AsRef<Path>
) -> TractResult<ProtoModel>
[src]
&self,
path: impl AsRef<Path>
) -> TractResult<ProtoModel>