[][src]Struct tensorflow::OperationDescription

pub struct OperationDescription<'a> { /* fields omitted */ }

An OperationDescription is an Operation in the process of being built (i.e. the builder pattern).

An OperationDescription is required to be finished before the graph goes out of scope, so finish() will be called on drop if it was not already called.

Methods

impl<'a> OperationDescription<'a>[src]

pub fn finish(self) -> Result<Operation>[src]

Builds the operation and adds it to the graph.

pub fn set_device(&mut self, device: &str) -> Result<(), NulError>[src]

Sets the preferred device. The empty string means unconstrained.

pub fn add_input<I: Into<Output>>(&mut self, input: I)[src]

Adds an input to this operation.

The index in the port is an index into the source operation's output array.

pub fn add_input_list(&mut self, inputs: &[Output])[src]

Adds multiple inputs to this operation.

The index in the ports is an index into the source operation's output array.

pub fn add_control_input(&mut self, input: &Operation)[src]

Adds a control input.

pub fn set_attr_string(
    &mut self,
    attr_name: &str,
    value: &str
) -> Result<(), NulError>
[src]

Sets the value of a string attribute.

pub fn set_attr_string_list<S: AsRef<str>>(
    &mut self,
    attr_name: &str,
    value: &[S]
) -> Result<(), NulError>
[src]

Sets the value of an attribute which holds a list of strings.

pub fn set_attr_func_name(
    &mut self,
    attr_name: &str,
    value: &str
) -> Result<(), NulError>
[src]

Sets the value of a function attribute.

pub fn set_attr_int(
    &mut self,
    attr_name: &str,
    value: i64
) -> Result<(), NulError>
[src]

Sets an int-valued attribute.

pub fn set_attr_int_list(
    &mut self,
    attr_name: &str,
    value: &[i64]
) -> Result<(), NulError>
[src]

Sets an attribute which holds an array of ints.

pub fn set_attr_float(
    &mut self,
    attr_name: &str,
    value: f32
) -> Result<(), NulError>
[src]

Sets a float-valued attribute.

pub fn set_attr_float_list(
    &mut self,
    attr_name: &str,
    value: &[f32]
) -> Result<(), NulError>
[src]

Sets an attribute which holds an array of floats.

pub fn set_attr_bool(
    &mut self,
    attr_name: &str,
    value: bool
) -> Result<(), NulError>
[src]

Sets a boolean-valued attribute.

pub fn set_attr_bool_list(
    &mut self,
    attr_name: &str,
    value: &[bool]
) -> Result<(), NulError>
[src]

Sets an attribute which holds an array of booleans.

pub fn set_attr_type(
    &mut self,
    attr_name: &str,
    value: DataType
) -> Result<(), NulError>
[src]

Sets a type-valued attribute.

pub fn set_attr_type_list(
    &mut self,
    attr_name: &str,
    value: &[DataType]
) -> Result<(), NulError>
[src]

Sets an attribute which holds an array of types.

pub fn set_attr_shape(
    &mut self,
    attr_name: &str,
    value: &Shape
) -> Result<(), NulError>
[src]

Sets a shape-valued attribute.

pub fn set_attr_shape_list(
    &mut self,
    attr_name: &str,
    value: &[Shape]
) -> Result<(), NulError>
[src]

Sets an attribute which holds an array of shapes.

pub fn set_attr_tensor_shape_proto(
    &mut self,
    attr_name: &str,
    value: &[u8]
) -> Result<()>
[src]

Sets an attribute with a TensorShapeProto protobuf.

pub fn set_attr_tensor_shape_proto_list<T: AsRef<[u8]>>(
    &mut self,
    attr_name: &str,
    value: &[T]
) -> Result<()>
[src]

Sets an attribute with an array of TensorShapeProto protobufs.

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

Sets a tensor-valued attribute.

pub fn set_attr_tensor_list<I, T>(
    &mut self,
    attr_name: &str,
    value: I
) -> Result<()> where
    I: IntoIterator<Item = Tensor<T>>,
    T: TensorType
[src]

Sets an attribute which holds an array of tensors.

pub fn set_attr_to_attr_value_proto(
    &mut self,
    attr_name: &str,
    value: &[u8]
) -> Result<()>
[src]

Deprecated since 0.7.0:

Use set_attr_value_proto instead.

Sets an attribute with an AttrValue proto.

pub fn set_attr_value_proto(
    &mut self,
    attr_name: &str,
    value: &[u8]
) -> Result<()>
[src]

Sets an attribute with an AttrValue proto.

Trait Implementations

impl<'a> Drop for OperationDescription<'a>[src]

impl<'a> Debug for OperationDescription<'a>[src]

Auto Trait Implementations

impl<'a> !Send for OperationDescription<'a>

impl<'a> !Sync for OperationDescription<'a>

Blanket Implementations

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

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

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