Struct tract_tensorflow::tfpb::tensorflow::GraphDef
source · pub struct GraphDef {
pub node: Vec<NodeDef>,
pub versions: Option<VersionDef>,
pub version: i32,
pub library: Option<FunctionDefLibrary>,
}
Expand description
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.
Implementations§
Trait Implementations§
source§impl Framework<GraphDef, Graph<InferenceFact, Box<dyn InferenceOp>>> for Tensorflow
impl Framework<GraphDef, Graph<InferenceFact, Box<dyn InferenceOp>>> for Tensorflow
source§fn proto_model_for_path(&self, r: impl AsRef<Path>) -> TractResult<GraphDef>
fn proto_model_for_path(&self, r: impl AsRef<Path>) -> TractResult<GraphDef>
This method will try to read as frozen model, then as a saved model.
source§fn proto_model_for_read(&self, r: &mut dyn Read) -> TractResult<GraphDef>
fn proto_model_for_read(&self, r: &mut dyn Read) -> TractResult<GraphDef>
This method expects a frozen model, use open_saved_model for TF2 saved model format.
source§fn model_for_proto_model_with_symbols(
&self,
graph: &GraphDef,
symbols: &SymbolTable
) -> TractResult<InferenceModel>
fn model_for_proto_model_with_symbols( &self, graph: &GraphDef, symbols: &SymbolTable ) -> TractResult<InferenceModel>
source§fn model_for_proto_model(&self, proto: &ProtoModel) -> Result<Model, Error>
fn model_for_proto_model(&self, proto: &ProtoModel) -> Result<Model, Error>
source§impl Message for GraphDef
impl Message for GraphDef
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.source§impl PartialEq for GraphDef
impl PartialEq for GraphDef
impl StructuralPartialEq for GraphDef
Auto Trait Implementations§
impl Freeze for GraphDef
impl RefUnwindSafe for GraphDef
impl Send for GraphDef
impl Sync for GraphDef
impl Unpin for GraphDef
impl UnwindSafe for GraphDef
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more