Struct tfrecord::protos::OpDef[][src]

pub struct OpDef {
    pub name: String,
    pub input_arg: Vec<ArgDef>,
    pub output_arg: Vec<ArgDef>,
    pub control_output: Vec<String>,
    pub attr: Vec<AttrDef>,
    pub deprecation: Option<OpDeprecation>,
    pub summary: String,
    pub description: String,
    pub is_commutative: bool,
    pub is_aggregate: bool,
    pub is_stateful: bool,
    pub allows_uninitialized_input: bool,
}

Defines an operation. A NodeDef in a GraphDef specifies an Op by using the “op” field which should match the name of a OpDef. LINT.IfChange

Fields

name: String

Op names starting with an underscore are reserved for internal use. Names should be CamelCase and match the regexp “[A-Z][a-zA-Z0-9>_]*”.

input_arg: Vec<ArgDef>

Description of the input(s).

output_arg: Vec<ArgDef>

Description of the output(s).

control_output: Vec<String>

Named control outputs for this operation. Useful only for composite operations (i.e. functions) which want to name different control outputs.

attr: Vec<AttrDef>deprecation: Option<OpDeprecation>

Optional deprecation based on GraphDef versions.

summary: String

One-line human-readable description of what the Op does.

description: String

Additional, longer human-readable description of what the Op does.

is_commutative: bool

True if the operation is commutative (“op(a,b) == op(b,a)” for all inputs)

is_aggregate: bool

If is_aggregate is true, then this operation accepts N >= 2 inputs and produces 1 output all of the same type. Should be associative and commutative, and produce output with the same shape as the input. The optimizer may replace an aggregate op taking input from multiple devices with a tree of aggregate ops that aggregate locally within each device (and possibly within groups of nearby devices) before communicating. TODO(josh11b): Implement that optimization.

for things like add

is_stateful: bool

Ops are marked as stateful if their behavior depends on some state beyond their input tensors (e.g. variable reading op) or if they have a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops must always produce the same output for the same input and have no side-effects.

By default Ops may be moved between devices. Stateful ops should either not be moved, or should only be moved if that state can also be moved (e.g. via some sort of save / restore). Stateful ops are guaranteed to never be optimized away by Common Subexpression Elimination (CSE).

for things like variables, queue

allows_uninitialized_input: bool

By default, all inputs to an Op must be initialized Tensors. Ops that may initialize tensors for the first time should set this field to true, to allow the Op to take an uninitialized Tensor as input.

for Assign, etc.

Trait Implementations

impl Clone for OpDef[src]

impl Debug for OpDef[src]

impl Default for OpDef[src]

impl<'de> Deserialize<'de> for OpDef[src]

impl Message for OpDef[src]

impl PartialEq<OpDef> for OpDef[src]

impl Serialize for OpDef[src]

impl StructuralPartialEq for OpDef[src]

Auto Trait Implementations

impl RefUnwindSafe for OpDef

impl Send for OpDef

impl Sync for OpDef

impl Unpin for OpDef

impl UnwindSafe for OpDef

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,