Struct tensorflow::WhileBuilder
source · pub struct WhileBuilder<'a> { /* private fields */ }
Expand description
A WhileBuilder is used to build a while loop.
Implementations§
source§impl<'a> WhileBuilder<'a>
impl<'a> WhileBuilder<'a>
sourcepub fn new<CF: Fn(&mut Graph, &[Output]) -> Result<Output>, BF: Fn(&mut Graph, &[Output]) -> Result<Vec<Output>>>(
graph: &'a mut Graph,
cond: CF,
body: BF,
inputs: &[Output]
) -> Result<Self>
pub fn new<CF: Fn(&mut Graph, &[Output]) -> Result<Output>, BF: Fn(&mut Graph, &[Output]) -> Result<Vec<Output>>>( graph: &'a mut Graph, cond: CF, body: BF, inputs: &[Output] ) -> Result<Self>
Creates a WhileBuilder for creating a while loop.
The loop is not actually added to the graph until finish
is called.
Arguments
graph
- graph to create the while loop incond
- takes the condition subgraph and loop variables and returns a scalar booleanbody
- takes the body subgraph and loop variables and returns the new values of the loop variablesinputs
- outputs that already exist ingraph
used as initial values for the loop variables
Returns
A unfinished WhileBuilder.
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for WhileBuilder<'a>
impl<'a> !Send for WhileBuilder<'a>
impl<'a> !Sync for WhileBuilder<'a>
impl<'a> Unpin for WhileBuilder<'a>
impl<'a> !UnwindSafe for WhileBuilder<'a>
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