[]Trait tract_tensorflow::prelude::Framework

pub trait Framework<ProtoModel, Model> where
    ProtoModel: Debug
{ fn proto_model_for_read(
        &self,
        reader: &mut dyn Read
    ) -> Result<ProtoModel, TractError>;
fn model_for_proto_model(
        &self,
        proto: &ProtoModel
    ) -> Result<Model, TractError>; fn proto_model_for_path(
        &self,
        p: impl AsRef<Path>
    ) -> Result<ProtoModel, TractError> { ... }
fn model_for_read(&self, r: &mut dyn Read) -> Result<Model, TractError> { ... }
fn model_for_path(&self, p: impl AsRef<Path>) -> Result<Model, TractError> { ... } }

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

fn proto_model_for_read(
    &self,
    reader: &mut dyn Read
) -> Result<ProtoModel, TractError>

Parse a proto model from a reader.

fn model_for_proto_model(&self, proto: &ProtoModel) -> Result<Model, TractError>

Translate a proto model into a model.

Loading content...

Provided methods

fn proto_model_for_path(
    &self,
    p: impl AsRef<Path>
) -> Result<ProtoModel, TractError>

Read a proto model from a filename.

fn model_for_read(&self, r: &mut dyn Read) -> Result<Model, TractError>

Read a model from a reader

fn model_for_path(&self, p: impl AsRef<Path>) -> Result<Model, TractError>

Build a model from a filename.

Loading content...

Implementors

impl Framework<GraphDef, Graph<InferenceFact, Box<dyn InferenceOp + 'static>>> for Tensorflow[src]

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.

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.

Loading content...