<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>TensorFlow.Build</title><linkhref="ocean.css"rel="stylesheet"type="text/css"title="Ocean"/><scriptsrc="haddock-util.js"type="text/javascript"></script><scripttype="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_TensorFlow-Build.html");};
</script></head><body><divid="package-header"><ulclass="links"id="page-menu"><li><ahref="index.html">Contents</a></li><li><ahref="doc-index.html">Index</a></li></ul><pclass="caption">tensorflow-0.1.0.0: TensorFlow bindings.</p></div><divid="content"><divid="module-header"><tableclass="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><pclass="caption">TensorFlow.Build</p></div><divid="table-of-contents"><pclass="caption">Contents</p><ul><li><ahref="#g:1">Graph node types</a></li><li><ahref="#g:2">Ops</a></li><li><ahref="#g:3">The Build monad</a></li><li><ahref="#g:4">Creating and looking up Ops</a></li><li><ahref="#g:5">Modifying all nodes in a Build action</a></li></ul></div><divid="synopsis"><pid="control.syn"class="caption expander"onclick="toggleSection('syn')">Synopsis</p><ulid="section.syn"class="hide"onclick="toggleSection('syn')"><liclass="src short"><spanclass="keyword">newtype</span><ahref="#t:ControlNode">ControlNode</a> = <ahref="#v:ControlNode">ControlNode</a> {<ulclass="subs"><li><ahref="#v:unControlNode">unControlNode</a> :: <ahref="TensorFlow-Output.html#t:NodeName">NodeName</a></li></ul>}</li><liclass="src short"><spanclass="keyword">data</span><ahref="#t:Unique">Unique</a></li><liclass="src short"><ahref="#v:explicitName">explicitName</a> :: Text -><ahref="TensorFlow-Output.html#t:PendingNodeName">PendingNodeName</a></li><liclass="src short"><ahref="#v:implicitName">implicitName</a> :: <ahref="TensorFlow-Output.html#t:PendingNodeName">PendingNodeName</a></li><liclass="src short"><ahref="#v:opDef">opDef</a> :: <ahref="TensorFlow-Output.html#t:OpType">OpType</a> -><ahref="TensorFlow-Output.html#t:OpDef">OpDef</a></li><liclass="src short"><ahref="#v:opDefWithName">opDefWithName</a> :: <ahref="TensorFlow-Output.html#t:PendingNodeName">PendingNodeName</a> -><ahref="TensorFlow-Output.html#t:OpType">OpType</a> -><ahref="TensorFlow-Output.html#t:OpDef">OpDef</a></li><liclass="src short"><ahref="#v:opName">opName</a> :: Lens' <ahref="TensorFlow-Output.html#t:OpDef">OpDef</a><ahref="TensorFlow-Output.html#t:PendingNodeName">PendingNodeName</a></li><liclass="src short"><ahref="#v:opType">opType</a> :: Lens' <ahref="TensorFlow-Output.html#t:OpDef">OpDef</a><ahref="TensorFlow-Output.html#t:OpType">OpType</a></li><liclass="src short"><ahref="#v:opAttr">opAttr</a> :: <ahref="TensorFlow-Types.html#t:Attribute">Attribute</a> a => Text -> Lens' <ahref="TensorFlow-Output.html#t:OpDef">OpDef</a> a</li><liclass="src short"><ahref="#v:opInputs">opInputs</a> :: Lens' <ahref="TensorFlow-Output.html#t:OpDef">OpDef</a> [<ahref="TensorFlow-Output.html#t:Output">Output</a>]</li><liclass="src short"><ahref="#v:opControlInputs">opControlInputs</a> :: Lens' <ahref="TensorFlow-Output.html#t:OpDef">OpDef</a> [<ahref="TensorFlow-Output.html#t:NodeName">NodeName</a>]</li><liclass="src short"><spanclass="keyword">data</span><ahref="#t:GraphState">GraphState</a></li><liclass="src short"><ahref="#v:renderedNodeDefs">renderedNodeDefs</a> :: Lens' <ahref="TensorFlow-Build.html#t:GraphState">GraphState</a> (<ahref="../containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a><ahref="TensorFlow-Output.html#t:NodeName">NodeName</a><ahref="../tensorflow-proto-0.1.0.0/Proto-Tensorflow-Core-Framework-NodeDef.html#t:NodeDef">NodeDef</a>)</li><liclass="src short"><spanclass="keyword">data</span><ahref="#t:BuildT">BuildT</a> m a</li><liclass="src short"><spanclass="keyword">type</span><ahref="#t:Build">Build</a> = <ahref="TensorFlow-Build.html#t:BuildT">BuildT</a><ahref="../base-4.8.2.0/Data-Functor-Identity.html#t:Identity">Identity</a></li><liclass="src short"><spanclass="keyword">class</span><ahref="../base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =><ahref="#t:MonadBuild">MonadBuild</a> m <spanclass="keyword">where</span><ulclass="subs"><li><ahref="#v:build">build</a> :: <ahref="TensorFlow-Build.html#t:Build">Build</a> a -> m a</li></ul></li><liclass="src short"
valuable for causing side effects when they are run.</p></div><divclass="subs constructors"><pclass="caption">Constructors</p><table><tr><tdclass="src"><aname="v:ControlNode"class="def">ControlNode</a></td><tdclass="doc empty"> </td></tr><tr><tdcolspan="2"><divclass="subs fields"><pclass="caption">Fields</p><dl><dtclass="src"><aname="v:unControlNode"class="def">unControlNode</a> :: <ahref="TensorFlow-Output.html#t:NodeName">NodeName</a></dt><ddclass="doc empty"> </dd></dl><divclass="clear"></div></div></td></tr></table></div><divclass="subs instances"><pid="control.i:ControlNode"class="caption collapser"onclick="toggleSection('i:ControlNode')">Instances</p><divid="section.i:ControlNode"class="show"><table><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-BuildOp.html#t:BuildResult">BuildResult</a><ahref="TensorFlow-Build.html#t:ControlNode">ControlNode</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Nodes.html#t:Nodes">Nodes</a><ahref="TensorFlow-Build.html#t:ControlNode">ControlNode</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">(~) * a () =><ahref="TensorFlow-Nodes.html#t:Fetchable">Fetchable</a><ahref="TensorFlow-Build.html#t:ControlNode">ControlNode</a> a</span></td><tdclass="doc empty"> </td></tr></table></div></div></div><divclass="top"><pclass="src"><spanclass="keyword">data</span><aname="t:Unique"class="def">Unique</a></p><divclass="subs instances"><pid="control.i:Unique"class="caption collapser"onclick="toggleSection('i:Unique')">Instances</p><divid="section.i:Unique"class="show"><table><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Prelude.html#t:Enum">Enum</a><ahref="TensorFlow-Build.html#t:Unique">Unique</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a><ahref="TensorFlow-Build.html#t:Unique">Unique</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Data-Ord.html#t:Ord">Ord</a><ahref="TensorFlow-Build.html#t:Unique">Unique</a></span></td><tdclass="doc empty"> </td></tr></table></div></div></div><h1id="g:2">Ops</h1><divclass="top"><pclass="src"><aname="v:explicitName"class="def">explicitName</a> :: Text -><ahref="TensorFlow-Output.html#t:PendingNodeName">PendingNodeName</a></p></div><divclass="top"><pclass="src"><aname="v:implicitName"class="def">implicitName</a> :: <ahref="TensorFlow-Output.html#t:PendingNodeName">PendingNodeName</a></p></div><divclass="top"><pclass="src"><aname="v:opDef"class="def">opDef</a> :: <ahref="TensorFlow-Output.html#t:OpType">OpType</a> -><ahref="TensorFlow-Output.html#t:OpDef">OpDef</a></p></div><divclass="top"><pclass="src"><aname="v:opDefWithName"class="def">opDefWithName</a> :: <ahref="TensorFlow-Output.html#t:PendingNodeName">PendingNodeName</a> -><ahref="TensorFlow-Output.html#t:OpType">OpType</a> -><ahref="TensorFlow-Output.html#t:OpDef">OpDef</a></p></div><divclass="top"><pclass="src"><aname="v:opName"class="def">opName</a> :: Lens' <ahref="TensorFlow-Output.html#t:OpDef">OpDef</a><ahref="TensorFlow-Output.html#t:PendingNodeName">PendingNodeName</a></p></div><divclass="top"><pclass="src"><aname="v:opType"class="def">opType</a> :: Lens' <ahref="TensorFlow-Output.html#t:OpDef">OpDef</a><ahref="TensorFlow-Output.html#t:OpType">OpType</a></p></div><divclass="top"><pclass="src"><aname="v:opAttr"class="def">opAttr</a> :: <ahref="TensorFlow-Types.html#t:Attribute">Attribute</a> a => Text -> Lens' <ahref="TensorFlow-Output.html#t:OpDef">OpDef</a> a</p></div><divclass="top"><pclass="src"><aname="v:opInputs"class="def">opInputs</a> :: Lens' <ahref="TensorFlow-Output.html#t:OpDef">OpDef</a> [<ahref="TensorFlow-Output.html#t:Output">Output</a>]</p></div><divclass="top"><p
Used to manage build state internally as part of the <code>Session</code> monad.</p></div><divclass="subs instances"><pid="control.i:BuildT"class="caption collapser"onclick="toggleSection('i:BuildT')">Instances</p><divid="section.i:BuildT"class="show"><table><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../transformers-0.4.2.0/Control-Monad-Trans-Class.html#t:MonadTrans">MonadTrans</a><ahref="TensorFlow-Build.html#t:BuildT">BuildT</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Tensor.html#t:TensorKind">TensorKind</a><ahref="TensorFlow-Build.html#t:Build">Build</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m => MonadState <ahref="TensorFlow-Build.html#t:GraphState">GraphState</a> (<ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =><ahref="../base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> (<ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Data-Functor.html#t:Functor">Functor</a> m =><ahref="../base-4.8.2.0/Data-Functor.html#t:Functor">Functor</a> (<ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =><ahref="../base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a> (<ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../transformers-0.4.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m =><ahref="../transformers-0.4.2.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> (<ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">MonadThrow m => MonadThrow (<ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">MonadMask m => MonadMask (<ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">MonadCatch m => MonadCatch (<ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =><ahref="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> (<ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Types.html#t:TensorTypes">TensorTypes</a> as =><ahref="TensorFlow-BuildOp.html#t:PureResult">PureResult</a> (<ahref="TensorFlow-Tensor.html#t:TensorList">TensorList</a><ahref="TensorFlow-Build.html#t:Build">Build</a> as)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-BuildOp.html#t:PureResult">PureResult</a> (<ahref="TensorFlow-Tensor.html#t:Tensor">Tensor</a><ahref="TensorFlow-Build.html#t:Build">Build</a> a)</span></td><tdclass="doc empty"> </td></tr></table></div></div></div><divclass="top"><pclass="src"><spanclass="keyword">type</span><aname="t:Build"class="def">Build</a> = <ahref="TensorFlow-Build.html#t:BuildT">BuildT</a><ahref="../base-4.8.2.0/Data-Functor-Identity.html#t:Identity">Identity</a></p><divclass="doc"><p>An action for building nodes in a TensorFlow graph.</p></div></div><divclas
<code><ahref="TensorFlow-Session.html#v:run">run</a></code>.</p></div></div><divclass="top"><pclass="src"><aname="v:hoistBuildT"class="def">hoistBuildT</a> :: (<spanclass="keyword">forall</span> a. m a -> n a) -><ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m b -><ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> n b</p><divclass="doc"><p>This is Control.Monad.Morph.hoist sans the dependency.</p></div></div><divclass="top"><pclass="src"><aname="v:evalBuildT"class="def">evalBuildT</a> :: <ahref="../base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =><ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m a -> m a</p></div><divclass="top"><pclass="src"><aname="v:runBuildT"class="def">runBuildT</a> :: <ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m a -> m (a, <ahref="TensorFlow-Build.html#t:GraphState">GraphState</a>)</p></div><divclass="top"><pclass="src"><aname="v:asGraphDef"class="def">asGraphDef</a> :: <ahref="TensorFlow-Build.html#t:Build">Build</a> a -><ahref="../tensorflow-proto-0.1.0.0/Proto-Tensorflow-Core-Framework-Graph.html#t:GraphDef">GraphDef</a></p><divclass="doc"><p>Produce a GraphDef proto representation of the nodes that are rendered in
the given <code><ahref="TensorFlow-Build.html#t:Build">Build</a></code> action.</p></div></div><divclass="top"><pclass="src"><aname="v:addGraphDef"class="def">addGraphDef</a> :: <ahref="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> m =><ahref="../tensorflow-proto-0.1.0.0/Proto-Tensorflow-Core-Framework-Graph.html#t:GraphDef">GraphDef</a> -> m ()</p></div><divclass="top"><pclass="src"><aname="v:flushInitializers"class="def">flushInitializers</a> :: <ahref="../base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =><ahref="TensorFlow-Build.html#t:BuildT">BuildT</a> m [<ahref="TensorFlow-Output.html#t:NodeName">NodeName</a>]</p><divclass="doc"><p>Get all the initializers that have accumulated so far, and clear
that buffer.</p></div></div><divclass="top"><pclass="src"><aname="v:flushNodeBuffer"class="def">flushNodeBuffer</a> :: <ahref="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> m => m [<ahref="../tensorflow-proto-0.1.0.0/Proto-Tensorflow-Core-Framework-NodeDef.html#t:NodeDef">NodeDef</a>]</p><divclass="doc"><p>Get all the NodeDefs that have accumulated so far, and clear that buffer.</p></div></div><divclass="top"><pclass="src"><aname="v:summaries"class="def">summaries</a> :: Lens' <ahref="TensorFlow-Build.html#t:GraphState">GraphState</a> [<ahref="TensorFlow-Output.html#t:Output">Output</a>]</p></div><h1id="g:4">Creating and looking up Ops</h1><divclass="top"><pclass="src"><aname="v:getOrAddOp"class="def">getOrAddOp</a> :: <ahref="TensorFlow-Output.html#t:OpDef">OpDef</a> -><ahref="TensorFlow-Build.html#t:Build">Build</a><ahref="TensorFlow-Output.html#t:NodeName">NodeName</a></p><divclass="doc"><p>Render the given op if it hasn't been rendered already, and return its
name.</p></div></div><divclass="top"><pclass="src"><aname="v:addNewOp"class="def">addNewOp</a> :: <ahref="TensorFlow-Output.html#t:OpDef">OpDef</a> -><ahref="TensorFlow-Build.html#t:Build">Build</a><ahref="TensorFlow-Output.html#t:NodeName">NodeName</a></p><divclass="doc"><p>Add a new node for a given <code><ahref="TensorFlow-Output.html#t:OpDef">OpDef</a></code>. This is used for making "stateful" ops
which are not safe to dedup (e.g, "variable" and "assign").</p></div></div><divclass="top"><pclass="src"><aname="v:encodeOutput"class="def">encodeOutput</a> :: <ahref="TensorFlow-Output.html#t:Output">Output</a> -> Text</p><divclass="doc"><p>Turn an <code><ahref="TensorFlow-Output.html#t:Output">Output</a></code> into a string representation for the TensorFlow
foreign APIs.</p></div></div><divclass="top"><pclass="src"><aname="v:lookupNode"class="def">lookupNode</a> :: <ahref="TensorFlow-Output.html#t:NodeName">NodeName</a> -><ahref="TensorFlow-Build.html#t:Build">Build</a><ahref="../tensorflow-proto-0.1.0.0/Proto-Tensorflow-Core-Framework-NodeDef.html#t:NodeDef">NodeDef</a></p></div><h1id="g:5">Modifying all nodes in a Build action</h1><divclass="top"><pclass="src"><aname="v:withStateLens"class="def">withStateLens</a> :: <ahref="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> m => Lens' <ahref="TensorFlow-Build.html#t:GraphState">GraphState</a> a -> (a -> a) -> m b -> m b</p><divclass="doc"><p>Modify some part of the state, run an action, and restore the state
after that action is done.</p></div></div><divclass="top"><pclass="src"><aname="v:withDevice"class="def">withDevice</a> :: <ahref="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> m =><ahref="../base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a><ahref="TensorFlow-Output.html#t:Device">Device</a> -> m a -> m a</p><divclass="doc"><p>Set a device for all nodes rendered in the given <code><ahref="TensorFlow-Build.html#t:Build">Build</a></code> action
(unless further overridden by another use of withDevice).</p></div></div><divclass="top"><pclass="src"><aname="v:withNameScope"class="def">withNameScope</a> :: <ahref="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> m => Text -> m a -> m a</p><divclass="doc"><p>Prepend a scope to all nodes rendered in the given <code><ahref="TensorFlow-Build.html#t:Build">Build</a></code> action.</p></div></div><divclass="top"><pclass="src"><aname="v:withNodeDependencies"class="def">withNodeDependencies</a> :: <ahref="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> m =><ahref="../containers-0.5.6.2/Data-Set.html#t:Set">Set</a><ahref="TensorFlow-Output.html#t:NodeName">NodeName</a> -> m a -> m a</p><divclass="doc"><p>Add control inputs to all nodes rendered in the given <code><ahref="TensorFlow-Build.html#t:Build">Build</a></code> action.</p></div></div></div></div><divid="footer"><p>Produced by <ahref="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>