Struct tensorflow::OperationDescription
source · pub struct OperationDescription<'a> { /* private fields */ }
Expand description
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.
Implementations§
source§impl<'a> OperationDescription<'a>
impl<'a> OperationDescription<'a>
sourcepub fn set_device(&mut self, device: &str) -> Result<(), NulError>
pub fn set_device(&mut self, device: &str) -> Result<(), NulError>
Sets the preferred device. The empty string means unconstrained.
sourcepub fn add_input<I: Into<Output>>(&mut self, input: I)
pub fn add_input<I: Into<Output>>(&mut self, input: I)
Adds an input to this operation.
The index in the port is an index into the source operation’s output array.
sourcepub fn add_input_list(&mut self, inputs: &[Output])
pub fn add_input_list(&mut self, inputs: &[Output])
Adds multiple inputs to this operation.
The index in the ports is an index into the source operation’s output array.
sourcepub fn add_control_input(&mut self, input: &Operation)
pub fn add_control_input(&mut self, input: &Operation)
Adds a control input.
sourcepub fn set_attr_string(
&mut self,
attr_name: &str,
value: &str
) -> Result<(), NulError>
pub fn set_attr_string( &mut self, attr_name: &str, value: &str ) -> Result<(), NulError>
Sets the value of a string attribute.
sourcepub fn set_attr_string_list<S: AsRef<str>>(
&mut self,
attr_name: &str,
value: &[S]
) -> Result<(), NulError>
pub fn set_attr_string_list<S: AsRef<str>>( &mut self, attr_name: &str, value: &[S] ) -> Result<(), NulError>
Sets the value of an attribute which holds a list of strings.
sourcepub fn set_attr_func_name(
&mut self,
attr_name: &str,
value: &str
) -> Result<(), NulError>
pub fn set_attr_func_name( &mut self, attr_name: &str, value: &str ) -> Result<(), NulError>
Sets the value of a function attribute.
sourcepub fn set_attr_int(
&mut self,
attr_name: &str,
value: i64
) -> Result<(), NulError>
pub fn set_attr_int( &mut self, attr_name: &str, value: i64 ) -> Result<(), NulError>
Sets an int-valued attribute.
sourcepub fn set_attr_int_list(
&mut self,
attr_name: &str,
value: &[i64]
) -> Result<(), NulError>
pub fn set_attr_int_list( &mut self, attr_name: &str, value: &[i64] ) -> Result<(), NulError>
Sets an attribute which holds an array of ints.
sourcepub fn set_attr_float(
&mut self,
attr_name: &str,
value: f32
) -> Result<(), NulError>
pub fn set_attr_float( &mut self, attr_name: &str, value: f32 ) -> Result<(), NulError>
Sets a float-valued attribute.
sourcepub fn set_attr_float_list(
&mut self,
attr_name: &str,
value: &[f32]
) -> Result<(), NulError>
pub fn set_attr_float_list( &mut self, attr_name: &str, value: &[f32] ) -> Result<(), NulError>
Sets an attribute which holds an array of floats.
sourcepub fn set_attr_bool(
&mut self,
attr_name: &str,
value: bool
) -> Result<(), NulError>
pub fn set_attr_bool( &mut self, attr_name: &str, value: bool ) -> Result<(), NulError>
Sets a boolean-valued attribute.
sourcepub fn set_attr_bool_list(
&mut self,
attr_name: &str,
value: &[bool]
) -> Result<(), NulError>
pub fn set_attr_bool_list( &mut self, attr_name: &str, value: &[bool] ) -> Result<(), NulError>
Sets an attribute which holds an array of booleans.
sourcepub fn set_attr_type(
&mut self,
attr_name: &str,
value: DataType
) -> Result<(), NulError>
pub fn set_attr_type( &mut self, attr_name: &str, value: DataType ) -> Result<(), NulError>
Sets a type-valued attribute.
sourcepub fn set_attr_type_list(
&mut self,
attr_name: &str,
value: &[DataType]
) -> Result<(), NulError>
pub fn set_attr_type_list( &mut self, attr_name: &str, value: &[DataType] ) -> Result<(), NulError>
Sets an attribute which holds an array of types.
sourcepub fn set_attr_shape(
&mut self,
attr_name: &str,
value: &Shape
) -> Result<(), NulError>
pub fn set_attr_shape( &mut self, attr_name: &str, value: &Shape ) -> Result<(), NulError>
Sets a shape-valued attribute.
sourcepub fn set_attr_shape_list(
&mut self,
attr_name: &str,
value: &[Shape]
) -> Result<(), NulError>
pub fn set_attr_shape_list( &mut self, attr_name: &str, value: &[Shape] ) -> Result<(), NulError>
Sets an attribute which holds an array of shapes.
sourcepub fn set_attr_tensor_shape_proto(
&mut self,
attr_name: &str,
value: &[u8]
) -> Result<()>
pub fn set_attr_tensor_shape_proto( &mut self, attr_name: &str, value: &[u8] ) -> Result<()>
Sets an attribute with a TensorShapeProto
protobuf.
sourcepub fn set_attr_tensor_shape_proto_list<T: AsRef<[u8]>>(
&mut self,
attr_name: &str,
value: &[T]
) -> Result<()>
pub fn set_attr_tensor_shape_proto_list<T: AsRef<[u8]>>( &mut self, attr_name: &str, value: &[T] ) -> Result<()>
Sets an attribute with an array of TensorShapeProto
protobufs.
sourcepub fn set_attr_tensor<T: TensorType>(
&mut self,
attr_name: &str,
value: Tensor<T>
) -> Result<()>
pub fn set_attr_tensor<T: TensorType>( &mut self, attr_name: &str, value: Tensor<T> ) -> Result<()>
Sets a tensor-valued attribute.
sourcepub fn set_attr_tensor_list<I, T>(
&mut self,
attr_name: &str,
value: I
) -> Result<()>where
I: IntoIterator<Item = Tensor<T>>,
T: TensorType,
pub fn set_attr_tensor_list<I, T>( &mut self, attr_name: &str, value: I ) -> Result<()>where I: IntoIterator<Item = Tensor<T>>, T: TensorType,
Sets an attribute which holds an array of tensors.