[][src]Struct tensorflow::Operation

pub struct Operation { /* fields omitted */ }

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

Methods

impl Operation[src]

pub fn name(&self) -> Result<String, Utf8Error>[src]

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'.

pub fn op_type(&self) -> Result<String, Utf8Error>[src]

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

pub fn device(&self) -> Result<String, Utf8Error>[src]

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

pub fn num_outputs(&self) -> usize[src]

Returns the number of outputs.

pub fn output_type(&self, index: usize) -> DataType[src]

Returns the type of a specific output.

pub fn output_list_length(&self, arg_name: &str) -> Result<usize>[src]

pub fn num_inputs(&self) -> usize[src]

Returns the number of inputs.

pub fn input_type(&self, index: usize) -> DataType[src]

Returns the type of a specific input.

pub fn input_list_length(&self, arg_name: &str) -> Result<usize>[src]

pub fn input(&self, index: usize) -> (Operation, usize)[src]

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.

pub fn output_num_consumers(&self, index: usize) -> usize[src]

Returns the number of consumers of a specific output.

pub fn output_consumers(&self, index: usize) -> Vec<(Operation, usize)>[src]

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.

pub fn num_control_inputs(&self) -> usize[src]

Returns the number of control inputs.

pub fn control_inputs(&self) -> Vec<Operation>[src]

Returns the control inputs.

pub fn num_control_outputs(&self) -> usize[src]

Returns the number of control outputs.

pub fn control_outputs(&self) -> Vec<Operation>[src]

Returns the control outputs.

pub fn get_attr_metadata(&self, attr_name: &str) -> Result<AttrMetadata>[src]

Returns metadata about the value of the attribute attr_name.

pub fn get_attr_string(&self, attr_name: &str) -> Result<String>[src]

Returns the value of the attribute attr_name.

pub fn get_attr_string_list(&self, attr_name: &str) -> Result<Vec<String>>[src]

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

pub fn get_attr_int(&self, attr_name: &str) -> Result<i64>[src]

Returns the value of the attribute attr_name.

pub fn get_attr_int_list(&self, attr_name: &str) -> Result<Vec<i64>>[src]

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

pub fn get_attr_float(&self, attr_name: &str) -> Result<f32>[src]

Returns the value of the attribute attr_name.

pub fn get_attr_float_list(&self, attr_name: &str) -> Result<Vec<f32>>[src]

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

pub fn get_attr_bool(&self, attr_name: &str) -> Result<bool>[src]

Returns the value of the attribute attr_name.

pub fn get_attr_bool_list(&self, attr_name: &str) -> Result<Vec<bool>>[src]

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

pub fn get_attr_type(&self, attr_name: &str) -> Result<DataType>[src]

Returns the value of the attribute attr_name.

pub fn get_attr_type_list(&self, attr_name: &str) -> Result<Vec<DataType>>[src]

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

pub fn get_attr_shape(&self, attr_name: &str) -> Result<Shape>[src]

Returns the value of the attribute attr_name.

pub fn get_attr_shape_list(&self, attr_name: &str) -> Result<Vec<Shape>>[src]

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

pub fn get_attr_tensor_shape_proto(&self, attr_name: &str) -> Result<Vec<u8>>[src]

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

pub fn get_attr_tensor_shape_proto_list(
    &self,
    attr_name: &str
) -> Result<Vec<Vec<u8>>>
[src]

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

pub fn get_attr_tensor<T: TensorType>(
    &self,
    attr_name: &str
) -> Result<Tensor<T>>
[src]

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.

pub fn get_attr_tensor_list<T: TensorType>(
    &self,
    attr_name: &str
) -> Result<Vec<Tensor<T>>>
[src]

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.

pub fn get_attr_value_proto(&self, attr_name: &str) -> Result<Vec<u8>>[src]

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

Trait Implementations

impl Into<Output> for Operation[src]

fn into(self) -> Output[src]

Creates an Output for index 0.

impl Send for Operation[src]

impl Clone for Operation[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Sync for Operation[src]

impl Debug for Operation[src]

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.