[][src]Struct tensorflow::Session

pub struct Session { /* fields omitted */ }

Manages a single graph and execution.

Methods

impl Session[src]

pub fn new(options: &SessionOptions, graph: &Graph) -> Result<Self>[src]

Creates a session. graph will be be kept alive for the lifetime of the returned session. New nodes can still be added to graph after this call.

pub fn from_saved_model<P: AsRef<Path>, Tag: AsRef<str>, Tags: IntoIterator<Item = Tag>>(
    options: &SessionOptions,
    tags: Tags,
    graph: &mut Graph,
    export_dir: P
) -> Result<Self>
[src]

Loads a session from an exported model.

pub fn close(&mut self) -> Result<()>[src]

Closes the session.

pub fn run(&self, step: &mut SessionRunArgs) -> Result<()>[src]

Runs the graph, feeding the inputs and then fetching the outputs requested in the step. Note that the session has interior mutability; this may mutate variables in the graph, and the caller is responsible for handling race conditions.

pub fn device_list(&self) -> Result<Vec<Device>>[src]

Lists all devices in a session.

Trait Implementations

impl Send for Session[src]

impl Sync for Session[src]

impl Drop for Session[src]

impl Debug for Session[src]

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]