pub struct Operation { /* private fields */ }
Expand description

An Operation is a node in a Graph. It is a computation which accepts inputs and produces outputs.

Implementations

Returns the name of the operation.

This is the name of the specific computational step, not an operation type, so it may look like 'add_x_and_y' instead of 'Add', although it may be a generated ID like 'Add_123'.

Returns the type of operation. This will be something like 'Add', 'Mul', etc.

Returns the device for this operation. The empty string means unconstrained.

Returns the number of outputs.

Returns the type of a specific output.

Returns the number of inputs.

Returns the type of a specific input.

Returns the given input edge. The index argument is the index into the current operation’s input array, and the return value is the source operation and the index into its output array.

Returns the number of consumers of a specific output.

Returns the consumers of a specific output. The index argument is the index into the current operation’s output array, and the return value is a vector of the destination operation and the index into its input array.

Returns the number of control inputs.

Returns the control inputs.

Returns the number of control outputs.

Returns the control outputs.

Returns metadata about the value of the attribute attr_name.

Returns the value of the attribute attr_name.

Get the list of strings in the value of the attribute attr_name.

Returns the value of the attribute attr_name.

Get the list of ints in the value of the attribute attr_name.

Returns the value of the attribute attr_name.

Get the list of floats in the value of the attribute attr_name.

Returns the value of the attribute attr_name.

Get the list of bools in the value of the attribute attr_name.

Returns the value of the attribute attr_name.

Get the list of types in the value of the attribute attr_name.

Returns the value of the attribute attr_name.

Get the list of shapes in the value of the attribute attr_name.

Returns the binary-serialized TensorShapeProto value of the attribute attr_name.

Get the list of binary-serialized TensorShapeProtos in the value of the attribute attr_name.

Returns the value of the attribute attr_name. Returns an error if the type of the tensor value does not match the type of the generic argument.

Get the list of tensors in the value of the attribute attr_name. Returns an error if the type of the tensor value does not match the type of the generic argument.

Returns the binary-serialized AttrValue proto representation of the value of the attr_name attr.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Creates an Output for index 0.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.