| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
TensorFlow.Session
Synopsis
- type Session = SessionT IO
- data SessionT m a
- data Options
- sessionConfig :: Lens' Options ConfigProto
- sessionTarget :: Lens' Options ByteString
- sessionTracer :: Lens' Options Tracer
- runSession :: (MonadMask m, MonadIO m) => SessionT m a -> m a
- runSessionWithOptions :: (MonadMask m, MonadIO m) => Options -> SessionT m a -> m a
- class Monad m => MonadBuild m where
- extend :: MonadIO m => SessionT m ()
- addGraphDef :: MonadBuild m => GraphDef -> m ()
- run :: (MonadIO m, Fetchable t a) => t -> SessionT m a
- runWithFeeds :: (MonadIO m, Fetchable t a) => [Feed] -> t -> SessionT m a
- run_ :: (MonadIO m, Nodes t) => t -> SessionT m ()
- runWithFeeds_ :: (MonadIO m, Nodes t) => [Feed] -> t -> SessionT m ()
- asyncProdNodes :: (MonadIO m, Nodes t) => t -> SessionT m ()
Documentation
Instances
| MonadTrans SessionT Source # | |
Defined in TensorFlow.Session | |
| Monad m => Monad (SessionT m) Source # | |
| Functor m => Functor (SessionT m) Source # | |
| MonadFail m => MonadFail (SessionT m) Source # | |
Defined in TensorFlow.Session | |
| Monad m => Applicative (SessionT m) Source # | |
Defined in TensorFlow.Session | |
| MonadIO m => MonadIO (SessionT m) Source # | |
Defined in TensorFlow.Session | |
| MonadCatch m => MonadCatch (SessionT m) Source # | |
| MonadMask m => MonadMask (SessionT m) Source # | |
Defined in TensorFlow.Session | |
| MonadThrow m => MonadThrow (SessionT m) Source # | |
Defined in TensorFlow.Session | |
| Monad m => MonadBuild (SessionT m) Source # | |
Customization for session. Use the lenses to update:
sessionTarget, sessionTracer, sessionConfig.
sessionConfig :: Lens' Options ConfigProto Source #
Uses the specified config for the created session.
sessionTarget :: Lens' Options ByteString Source #
Target can be: "local", ip:port, host:port. The set of supported factories depends on the linked in libraries.
sessionTracer :: Lens' Options Tracer Source #
Uses the given logger to monitor session progress.
runSession :: (MonadMask m, MonadIO m) => SessionT m a -> m a Source #
Run Session actions in a new TensorFlow session.
runSessionWithOptions :: (MonadMask m, MonadIO m) => Options -> SessionT m a -> m a Source #
Run Session actions in a new TensorFlow session created with
the given option setter actions (sessionTarget, sessionConfig).
class Monad m => MonadBuild m where Source #
Lift a Build action into a monad, including any explicit op renderings.
extend :: MonadIO m => SessionT m () Source #
Add all pending rendered nodes to the TensorFlow graph and runs any pending initializers.
Note that run, runWithFeeds, etc. will all call this function implicitly.
addGraphDef :: MonadBuild m => GraphDef -> m () Source #
run :: (MonadIO m, Fetchable t a) => t -> SessionT m a Source #
Run a subgraph t, rendering any dependent nodes that aren't already
rendered, and fetch the corresponding values for a.
runWithFeeds :: (MonadIO m, Fetchable t a) => [Feed] -> t -> SessionT m a Source #
Run a subgraph t, rendering any dependent nodes that aren't already
rendered, feed the given input values, and fetch the corresponding result
values for a.
run_ :: (MonadIO m, Nodes t) => t -> SessionT m () Source #
Run a subgraph t, rendering and extending any dependent nodes that aren't
already rendered. This behaves like run except that it doesn't do any
fetches.
runWithFeeds_ :: (MonadIO m, Nodes t) => [Feed] -> t -> SessionT m () Source #
Run a subgraph t, rendering any dependent nodes that aren't already
rendered, feed the given input values, and fetch the corresponding result
values for a. This behaves like runWithFeeds except that it doesn't do
any fetches.
Starts a concurrent thread which evaluates the given Nodes forever until runSession exits or an exception occurs. Graph extension happens synchronously, but the resultant run proceeds as a separate thread.