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

pub struct SignatureDef {
    pub inputs: HashMap<String, TensorInfo>,
    pub outputs: HashMap<String, TensorInfo>,
    pub method_name: String,
}

SignatureDef defines the signature of a computation supported by a TensorFlow graph.

For example, a model with two loss computations, sharing a single input, might have the following signature_def map.

Note that across the two SignatureDefs "loss_A" and "loss_B", the input key, output key, and method_name are identical, and will be used by system(s) that implement or rely upon this particular loss method. The output tensor names differ, demonstrating how different outputs can exist for the same method.

signature_def { key: "loss_A" value { inputs { key: "input" value { name: "input:0" dtype: DT_STRING tensor_shape: ... } } outputs { key: "loss_output" value { name: "loss_output_A:0" dtype: DT_FLOAT tensor_shape: ... } } } ... method_name: "some/package/compute_loss" } signature_def { key: "loss_B" value { inputs { key: "input" value { name: "input:0" dtype: DT_STRING tensor_shape: ... } } outputs { key: "loss_output" value { name: "loss_output_B:0" dtype: DT_FLOAT tensor_shape: ... } } } ... method_name: "some/package/compute_loss" }

Fields

inputs: HashMap<String, TensorInfo>

Named input parameters.

outputs: HashMap<String, TensorInfo>

Named output parameters.

method_name: String

Extensible method_name information enabling third-party users to mark a SignatureDef as supporting a particular method. This enables producers and consumers of SignatureDefs, e.g. a model definition library and a serving library to have a clear hand-off regarding the semantics of a computation.

Note that multiple SignatureDefs in a single MetaGraphDef may have the same method_name. This is commonly used to support multi-headed computation, where a single graph computation may return multiple results.

Trait Implementations

impl Clone for SignatureDef[src]

impl Debug for SignatureDef[src]

impl Default for SignatureDef[src]

impl Message for SignatureDef[src]

impl PartialEq<SignatureDef> for SignatureDef[src]

impl StructuralPartialEq for SignatureDef[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.