Struct tensorflow::StepWithGraph
[−]
[src]
pub struct StepWithGraph<'l> { /* fields omitted */ }
Manages the inputs and outputs for a single execution of a graph.
Typical usage involves creating an instance of this struct,
adding some inputs to it, requesting some outputs, passing it to Session::run
and then taking the outputs out of it.
This will be renamed to Step once the old API goes away.
Methods
impl<'l> StepWithGraph<'l>
[src]
fn new() -> Self
[src]
Creates a StepWithGraph.
fn add_input<T: TensorType>(
&mut self,
operation: &Operation,
index: c_int,
tensor: &'l Tensor<T>
)
[src]
&mut self,
operation: &Operation,
index: c_int,
tensor: &'l Tensor<T>
)
Adds an input to be fed to the graph.
fn request_output(&mut self, operation: &Operation, index: c_int) -> OutputToken
[src]
Requests that an output is fetched from the graph after running this step. Returns an index that you can then use to fetch this output from the step after running it.
fn take_output<T: TensorType>(
&mut self,
token: OutputToken
) -> Result<Tensor<T>>
[src]
&mut self,
token: OutputToken
) -> Result<Tensor<T>>
Extracts a tensor output given an index. A given index can only be extracted
once per Session::run
.
Returns an error if output_idx is out of range, output is unavailable or the
requested type does not match the type of the actual tensor.
fn add_target(&mut self, operation: &Operation)
[src]
Adds a target operation to be executed when running the graph.
fn output_data_type(&self, output_idx: usize) -> Option<DataType>
[src]
Retuns the type of the tensor given an index.
Returns None
if the index is out of range or the output is not yet available.