Struct tensorflow::Function
source · pub struct Function { /* private fields */ }
Expand description
Function is a grouping of operations with defined inputs and outputs. Once created and added to graphs, functions can be invoked by creating an operation whose operation type matches the function name.
Implementations§
source§impl Function
impl Function
sourcepub fn to_function_def(&self) -> Result<Vec<u8>>
pub fn to_function_def(&self) -> Result<Vec<u8>>
Returns a serialized representation of the function (as a FunctionDef protocol message).
May fail on very large graphs in the future.
sourcepub fn import_function_def(proto: &[u8]) -> Result<Function>
pub fn import_function_def(proto: &[u8]) -> Result<Function>
Construct and return the function whose FunctionDef representation is
serialized in proto
. Returns a newly created Function
instance.
sourcepub fn set_attr_value_proto(
&mut self,
attr_name: &str,
proto: &[u8]
) -> Result<()>
pub fn set_attr_value_proto( &mut self, attr_name: &str, proto: &[u8] ) -> Result<()>
Sets function attribute named attr_name
to value stored in proto
. If
this attribute is already set to another value, it is overriden. proto
should be a sequence of bytes representing a binary serialization of an
AttrValue protocol buffer.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Function
impl !Send for Function
impl !Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more