Trait tract_core::framework::Framework
source · [−]pub trait Framework<ProtoModel, Model>: Send + Syncwhere
ProtoModel: Debug,{
fn proto_model_for_read(
&self,
reader: &mut dyn Read
) -> TractResult<ProtoModel>;
fn model_for_proto_model(&self, proto: &ProtoModel) -> TractResult<Model>;
fn proto_model_for_path(
&self,
p: impl AsRef<Path>
) -> TractResult<ProtoModel> { ... }
fn model_for_read(&self, r: &mut dyn Read) -> TractResult<Model> { ... }
fn model_for_path(&self, p: impl AsRef<Path>) -> TractResult<Model> { ... }
}Expand description
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
sourcefn proto_model_for_read(&self, reader: &mut dyn Read) -> TractResult<ProtoModel>
fn proto_model_for_read(&self, reader: &mut dyn Read) -> TractResult<ProtoModel>
Parse a proto model from a reader.
sourcefn model_for_proto_model(&self, proto: &ProtoModel) -> TractResult<Model>
fn model_for_proto_model(&self, proto: &ProtoModel) -> TractResult<Model>
Translate a proto model into a model.
Provided Methods
sourcefn proto_model_for_path(&self, p: impl AsRef<Path>) -> TractResult<ProtoModel>
fn proto_model_for_path(&self, p: impl AsRef<Path>) -> TractResult<ProtoModel>
Read a proto model from a filename.
sourcefn model_for_read(&self, r: &mut dyn Read) -> TractResult<Model>
fn model_for_read(&self, r: &mut dyn Read) -> TractResult<Model>
Read a model from a reader
sourcefn model_for_path(&self, p: impl AsRef<Path>) -> TractResult<Model>
fn model_for_path(&self, p: impl AsRef<Path>) -> TractResult<Model>
Build a model from a filename.