[][src]Struct tract_tensorflow::tfpb::tensorflow::GraphDef

pub struct GraphDef {
    pub node: Vec<NodeDef>,
    pub versions: Option<VersionDef>,
    pub version: i32,
    pub library: Option<FunctionDefLibrary>,
}

Represents the graph of operations

Fields

node: Vec<NodeDef>versions: Option<VersionDef>

Compatibility versions of the graph. See core/public/version.h for version history. The GraphDef version is distinct from the TensorFlow version, and each release of TensorFlow will support a range of GraphDef versions.

version: i32

Deprecated single version field; use versions above instead. Since all GraphDef changes before "versions" was introduced were forward compatible, this field is entirely ignored.

library: Option<FunctionDefLibrary>

EXPERIMENTAL. DO NOT USE OR DEPEND ON THIS YET.

"library" provides user-defined functions.

Naming:

  • library.function.name are in a flat namespace. NOTE: We may need to change it to be hierarchical to support different orgs. E.g., { "/google/nn", { ... }}, { "/google/vision", { ... }} { "/org_foo/module_bar", { ... }} map<string, FunctionDefLib> named_lib;
  • If node[i].op is the name of one function in "library", node[i] is deemed as a function call. Otherwise, node[i].op must be a primitive operation supported by the runtime.

Function call semantics:

  • The callee may start execution as soon as some of its inputs are ready. The caller may want to use Tuple() mechanism to ensure all inputs are ready in the same time.

  • The consumer of return values may start executing as soon as the return values the consumer depends on are ready. The consumer may want to use Tuple() mechanism to ensure the consumer does not start until all return values of the callee function are ready.

Methods

impl GraphDef[src]

pub fn node(self, n: NodeDef) -> Self[src]

pub fn write_to_bytes(&self) -> TractResult<Vec<u8>>[src]

pub fn save_to<P: AsRef<Path>>(self, p: P) -> TractResult<()>[src]

Trait Implementations

impl Clone for GraphDef[src]

impl Debug for GraphDef[src]

impl Default for GraphDef[src]

impl Framework<GraphDef> 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.

impl Message for GraphDef[src]

impl PartialEq<GraphDef> for GraphDef[src]

impl StructuralPartialEq for GraphDef[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.