pub struct SessionRunArgs<'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.
Example:
let mut args = SessionRunArgs::new();
args.add_feed(&op1, 0, &tensor1);
args.add_feed(&op2, 0, &tensor2);
let result_token = args.request_fetch(&op3, 0);
session.run(&mut args)?;
let result_tensor = args.fetch(result_token)?;
See examples/addition.rs for a more concrete example.
Creates a SessionRunArgs.
Adds an input to be fed to the graph. The index selects which output of
the operation to feed. For most operations, there is only one output,
so the index should be 0.
Deprecated since 0.10.0
: Use add_feed instead.
Deprecated alias for add_feed.
Requests that an output is fetched from the graph after running this
step. The index selects which output of the operation to return. For
most operations, there is only one output, so the index should be 0.
Returns a token that you can then use to fetch this output from the args
after running it.
Deprecated since 0.10.0
: Use request_fetch instead.
Deprecated alias for request_fetch.
Extracts a tensor output given a token. A given token can only be
extracted once per Session::run. Returns an error if the token is
invalid, output is unavailable or the requested type does not match the
type of the actual tensor.
Deprecated since 0.10.0
: Use fetch instead.
Deprecated alias for fetch.
Adds a target operation to be executed when running the graph.
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.
Executes the destructor for this type. Read more
Formats the value using the given formatter. Read more
🔬 This is a nightly-only experimental API. (try_from)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from)