[][src]Struct tensorflow::WhileBuilder

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

A WhileBuilder is used to build a while loop.

Methods

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

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>
[src]

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 in
  • cond - takes the condition subgraph and loop variables and returns a scalar boolean
  • body - takes the body subgraph and loop variables and returns the new values of the loop variables
  • inputs - outputs that already exist in graph used as initial values for the loop variables

Returns

A unfinished WhileBuilder.

pub fn name(self, name: &str) -> Result<Self, NulError>[src]

Sets a unique name for this while loop. This is used as a prefix for created operations. If not set, a unique prefix will be generated.

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

Builds the while loop and returns the output tensors of the while loop.

Trait Implementations

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

Auto Trait Implementations

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

impl<'a> !Sync for WhileBuilder<'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> 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.