[−]Trait tract_tensorflow::prelude::Framework
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>
&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>
Translate a proto model into a model.
Provided methods
pub fn proto_model_for_path(
&self,
p: impl AsRef<Path>
) -> Result<ProtoModel, Error>
&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>
Read a model from a reader
pub fn model_for_path(&self, p: impl AsRef<Path>) -> Result<Model, Error>
Build a model from a filename.
Implementations on Foreign Types
impl Framework<ProtoModel, Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>> for Nnef
pub fn model_for_path(
&self,
p: impl AsRef<Path>
) -> Result<Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>, Error>
&self,
p: impl AsRef<Path>
) -> Result<Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>, Error>
pub fn proto_model_for_path(
&self,
path: impl AsRef<Path>
) -> Result<ProtoModel, Error>
&self,
path: impl AsRef<Path>
) -> Result<ProtoModel, Error>
pub fn proto_model_for_read(
&self,
reader: &mut dyn Read
) -> Result<ProtoModel, Error>
&self,
reader: &mut dyn Read
) -> Result<ProtoModel, Error>
pub fn model_for_proto_model(
&self,
proto: &ProtoModel
) -> Result<Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>, Error>
&self,
proto: &ProtoModel
) -> Result<Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>, Error>
Implementors
impl Framework<GraphDef, Graph<InferenceFact, Box<dyn InferenceOp + 'static, Global>>> for Tensorflow
[src]
pub fn proto_model_for_path(&self, r: impl AsRef<Path>) -> TractResult<GraphDef>
[src]
This method will try to read as frozen model, then as a saved model.
pub fn proto_model_for_read(&self, r: &mut dyn Read) -> TractResult<GraphDef>
[src]
This method expects a frozen model, use open_saved_model for TF2 saved model format.
pub fn model_for_proto_model(
&self,
graph: &GraphDef
) -> TractResult<InferenceModel>
[src]
&self,
graph: &GraphDef
) -> TractResult<InferenceModel>