mirror of
https://github.com/tensorflow/haskell.git
synced 2024-11-27 05:19:45 +01:00
14 lines
52 KiB
HTML
14 lines
52 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>TensorFlow.Build</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
|
||
|
window.onload = function () {pageLoad();};
|
||
|
//]]>
|
||
|
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/TensorFlow.Build.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">tensorflow-0.2.0.0: TensorFlow bindings.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">TensorFlow.Build</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Graph node types</a></li><li><a href="#g:2">Ops</a></li><li><a href="#g:3">The Build monad</a></li><li><a href="#g:4">Creating and looking up Ops</a></li><li><a href="#g:5">Modifying all nodes in a Build action</a></li></ul></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">newtype</span> <a href="#t:ControlNode">ControlNode</a> = <a href="#v:ControlNode">ControlNode</a> {<ul class="subs"><li><a href="#v:unControlNode">unControlNode</a> :: <a href="TensorFlow-Output.html#t:NodeName">NodeName</a></li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:Unique">Unique</a></li><li class="src short"><a href="#v:explicitName">explicitName</a> :: Text -> <a href="TensorFlow-Output.html#t:PendingNodeName">PendingNodeName</a></li><li class="src short"><a href="#v:implicitName">implicitName</a> :: <a href="TensorFlow-Output.html#t:PendingNodeName">PendingNodeName</a></li><li class="src short"><a href="#v:opDef">opDef</a> :: <a href="TensorFlow-Output.html#t:OpType">OpType</a> -> <a href="TensorFlow-Output.html#t:OpDef">OpDef</a></li><li class="src short"><a href="#v:opDefWithName">opDefWithName</a> :: <a href="TensorFlow-Output.html#t:PendingNodeName">PendingNodeName</a> -> <a href="TensorFlow-Output.html#t:OpType">OpType</a> -> <a href="TensorFlow-Output.html#t:OpDef">OpDef</a></li><li class="src short"><a href="#v:opName">opName</a> :: Lens' <a href="TensorFlow-Output.html#t:OpDef">OpDef</a> <a href="TensorFlow-Output.html#t:PendingNodeName">PendingNodeName</a></li><li class="src short"><a href="#v:opType">opType</a> :: Lens' <a href="TensorFlow-Output.html#t:OpDef">OpDef</a> <a href="TensorFlow-Output.html#t:OpType">OpType</a></li><li class="src short"><a href="#v:opAttr">opAttr</a> :: <a href="TensorFlow-Types.html#t:Attribute">Attribute</a> a => Text -> Lens' <a href="TensorFlow-Output.html#t:OpDef">OpDef</a> a</li><li class="src short"><a href="#v:opInputs">opInputs</a> :: Lens' <a href="TensorFlow-Output.html#t:OpDef">OpDef</a> [<a href="TensorFlow-Output.html#t:Output">Output</a>]</li><li class="src short"><a href="#v:opControlInputs">opControlInputs</a> :: Lens' <a href="TensorFlow-Output.html#t:OpDef">OpDef</a> [<a href="TensorFlow-Output.html#t:NodeName">NodeName</a>]</li><li class="src short"><span class="keyword">data</span> <a href="#t:GraphState">GraphState</a></li><li class="src short"><a href="#v:renderedNodeDefs">renderedNodeDefs</a> :: Lens' <a href="TensorFlow-Build.html#t:GraphState">GraphState</a> (<a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="TensorFlow-Output.html#t:NodeName">NodeName</a> <a href="../tensorflow-proto-0.2.0.0/Proto-Tensorflow-Core-Framework-NodeDef.html#t:NodeDef">NodeDef</a>)</li><li class="src short"><span class="keyword">data</span> <a href="#t:BuildT">BuildT</a> m a</li><li class="src short"><span class="keyword">type</span> <a href="#t:Build">Build</a> = <a href="TensorFlow-Build.html#t:BuildT">BuildT</a> <a href="../base-4.10.1.0/Data-Functor-Identity.html#t:Identity">Identity</a></li><li class="src short"><span class="keyword">class</span> <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="#t:MonadBuild">MonadBuild</a> m <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><a href="#v:addInitializer">addInitiali
|
||
|
valuable for causing side effects when they are run.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:ControlNode" class="def">ControlNode</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:unControlNode" class="def">unControlNode</a> :: <a href="TensorFlow-Output.html#t:NodeName">NodeName</a></dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:ControlNode" class="caption collapser" onclick="toggleSection('i:ControlNode')">Instances</p><div id="section.i:ControlNode" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:ControlNode:Nodes:1" class="instance expander" onclick="toggleSection('i:id:ControlNode:Nodes:1')"></span> <a href="TensorFlow-Nodes.html#t:Nodes">Nodes</a> <a href="TensorFlow-Build.html#t:ControlNode">ControlNode</a></span> <a href="src/TensorFlow.Nodes.html#line-98" class="link">Source</a> <a href="#t:Nodes" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:ControlNode:Nodes:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:getNodes">getNodes</a> :: <a href="TensorFlow-Build.html#t:ControlNode">ControlNode</a> -> <a href="TensorFlow-Build.html#t:Build">Build</a> (<a href="../containers-0.5.10.2/Data-Set-Internal.html#t:Set">Set</a> <a href="TensorFlow-Output.html#t:NodeName">NodeName</a>) <a href="src/TensorFlow.Nodes.html#getNodes" class="link">Source</a> <a href="#v:getNodes" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:ControlNode:BuildResult:2" class="instance expander" onclick="toggleSection('i:id:ControlNode:BuildResult:2')"></span> <a href="TensorFlow-BuildOp.html#t:BuildResult">BuildResult</a> <a href="TensorFlow-Build.html#t:ControlNode">ControlNode</a></span> <a href="src/TensorFlow.BuildOp.html#line-132" class="link">Source</a> <a href="#t:BuildResult" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:ControlNode:BuildResult:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:buildResult">buildResult</a> :: Result <a href="TensorFlow-Build.html#t:ControlNode">ControlNode</a> <a href="src/TensorFlow.BuildOp.html#buildResult" class="link">Source</a> <a href="#v:buildResult" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:ControlNode:Fetchable:3" class="instance expander" onclick="toggleSection('i:id:ControlNode:Fetchable:3')"></span> (~) <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> a () => <a href="TensorFlow-Nodes.html#t:Fetchable">Fetchable</a> <a href="TensorFlow-Build.html#t:ControlNode">ControlNode</a> a</span> <a href="src/TensorFlow.Nodes.html#line-105" class="link">Source</a> <a href="#t:Fetchable" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:ControlNode:Fetchable:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:getFetch">getFetch</a> :: <a href="TensorFlow-Build.html#t:ControlNode">ControlNode</a> -> <a href="TensorFlow-Build.html#t:Build">Build</a> (<a href="TensorFlow-Nodes.html#t:Fetch">Fetch</a> a) <a href="src/TensorFlow.Nodes.html#getFetch" class="link">Source</a> <a href="#v:getFetch" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Unique" class="def">Unique</a> <a href="src/TensorFlow.Build.html#Unique" class="link">Source</a> <a href="#t:Unique" class="selflink">#</a></p><div class="subs instances"><p id="control.i:Unique" class="caption collapser" onclick="toggleSection('i:U
|
||
|
Used to manage build state internally as part of the <code>Session</code> monad.</p></div><div class="subs instances"><p id="control.i:BuildT" class="caption collapser" onclick="toggleSection('i:BuildT')">Instances</p><div id="section.i:BuildT" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:BuildT:MonadTrans:1" class="instance expander" onclick="toggleSection('i:id:BuildT:MonadTrans:1')"></span> <a href="../transformers-0.5.2.0/Control-Monad-Trans-Class.html#t:MonadTrans">MonadTrans</a> <a href="TensorFlow-Build.html#t:BuildT">BuildT</a></span> <a href="src/TensorFlow.Build.html#line-194" class="link">Source</a> <a href="#t:BuildT" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:BuildT:MonadTrans:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:lift">lift</a> :: <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> m => m a -> <a href="TensorFlow-Build.html#t:BuildT">BuildT</a> m a <a href="#v:lift" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:BuildT:TensorKind:2" class="instance expander" onclick="toggleSection('i:id:BuildT:TensorKind:2')"></span> <a href="TensorFlow-Tensor.html#t:TensorKind">TensorKind</a> <a href="TensorFlow-Build.html#t:Build">Build</a></span> <a href="src/TensorFlow.Tensor.html#line-191" class="link">Source</a> <a href="#t:TensorKind" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:BuildT:TensorKind:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toBuild">toBuild</a> :: <a href="TensorFlow-Build.html#t:Build">Build</a> a -> <a href="TensorFlow-Build.html#t:Build">Build</a> a <a href="src/TensorFlow.Tensor.html#toBuild" class="link">Source</a> <a href="#v:toBuild" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:BuildT:MonadState:3" class="instance expander" onclick="toggleSection('i:id:BuildT:MonadState:3')"></span> <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> m => MonadState <a href="TensorFlow-Build.html#t:GraphState">GraphState</a> (<a href="TensorFlow-Build.html#t:BuildT">BuildT</a> m)</span> <a href="src/TensorFlow.Build.html#line-195" class="link">Source</a> <a href="#t:BuildT" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:BuildT:MonadState:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:get">get</a> :: <a href="TensorFlow-Build.html#t:BuildT">BuildT</a> m <a href="TensorFlow-Build.html#t:GraphState">GraphState</a></p><p class="src"><a href="#v:put">put</a> :: <a href="TensorFlow-Build.html#t:GraphState">GraphState</a> -> <a href="TensorFlow-Build.html#t:BuildT">BuildT</a> m ()</p><p class="src"><a href="#v:state">state</a> :: (<a href="TensorFlow-Build.html#t:GraphState">GraphState</a> -> (a, <a href="TensorFlow-Build.html#t:GraphState">GraphState</a>)) -> <a href="TensorFlow-Build.html#t:BuildT">BuildT</a> m a</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:BuildT:Monad:4" class="instance expander" onclick="toggleSection('i:id:BuildT:Monad:4')"></span> <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> (<a href="TensorFlow-Build.html#t:BuildT">BuildT</a> m)</span> <a href="src/TensorFlow.Build.html#line-194" class="link">Source</a> <a href="#t:BuildT" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:BuildT:Monad:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-62--62--61-">(>>=)</a> :: <a href="TensorFlow-Build.html#t
|
||
|
<code><a href="TensorFlow-Session.html#v:run">run</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:hoistBuildT" class="def">hoistBuildT</a> :: (<span class="keyword">forall</span> a. m a -> n a) -> <a href="TensorFlow-Build.html#t:BuildT">BuildT</a> m b -> <a href="TensorFlow-Build.html#t:BuildT">BuildT</a> n b <a href="src/TensorFlow.Build.html#hoistBuildT" class="link">Source</a> <a href="#v:hoistBuildT" class="selflink">#</a></p><div class="doc"><p>This is Control.Monad.Morph.hoist sans the dependency.</p></div></div><div class="top"><p class="src"><a id="v:evalBuildT" class="def">evalBuildT</a> :: <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="TensorFlow-Build.html#t:BuildT">BuildT</a> m a -> m a <a href="src/TensorFlow.Build.html#evalBuildT" class="link">Source</a> <a href="#v:evalBuildT" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:runBuildT" class="def">runBuildT</a> :: <a href="TensorFlow-Build.html#t:BuildT">BuildT</a> m a -> m (a, <a href="TensorFlow-Build.html#t:GraphState">GraphState</a>) <a href="src/TensorFlow.Build.html#runBuildT" class="link">Source</a> <a href="#v:runBuildT" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:asGraphDef" class="def">asGraphDef</a> :: <a href="TensorFlow-Build.html#t:Build">Build</a> a -> <a href="../tensorflow-proto-0.2.0.0/Proto-Tensorflow-Core-Framework-Graph.html#t:GraphDef">GraphDef</a> <a href="src/TensorFlow.Build.html#asGraphDef" class="link">Source</a> <a href="#v:asGraphDef" class="selflink">#</a></p><div class="doc"><p>Produce a GraphDef proto representation of the nodes that are rendered in
|
||
|
the given <code><a href="TensorFlow-Build.html#t:Build">Build</a></code> action.</p></div></div><div class="top"><p class="src"><a id="v:addGraphDef" class="def">addGraphDef</a> :: <a href="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> m => <a href="../tensorflow-proto-0.2.0.0/Proto-Tensorflow-Core-Framework-Graph.html#t:GraphDef">GraphDef</a> -> m () <a href="src/TensorFlow.Build.html#addGraphDef" class="link">Source</a> <a href="#v:addGraphDef" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:flushInitializers" class="def">flushInitializers</a> :: <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="TensorFlow-Build.html#t:BuildT">BuildT</a> m [<a href="TensorFlow-Output.html#t:NodeName">NodeName</a>] <a href="src/TensorFlow.Build.html#flushInitializers" class="link">Source</a> <a href="#v:flushInitializers" class="selflink">#</a></p><div class="doc"><p>Get all the initializers that have accumulated so far, and clear
|
||
|
that buffer.</p></div></div><div class="top"><p class="src"><a id="v:flushNodeBuffer" class="def">flushNodeBuffer</a> :: <a href="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> m => m [<a href="../tensorflow-proto-0.2.0.0/Proto-Tensorflow-Core-Framework-NodeDef.html#t:NodeDef">NodeDef</a>] <a href="src/TensorFlow.Build.html#flushNodeBuffer" class="link">Source</a> <a href="#v:flushNodeBuffer" class="selflink">#</a></p><div class="doc"><p>Get all the NodeDefs that have accumulated so far, and clear that buffer.</p></div></div><div class="top"><p class="src"><a id="v:summaries" class="def">summaries</a> :: Lens' <a href="TensorFlow-Build.html#t:GraphState">GraphState</a> [<a href="TensorFlow-Output.html#t:Output">Output</a>] <a href="src/TensorFlow.Build.html#summaries" class="link">Source</a> <a href="#v:summaries" class="selflink">#</a></p></div><h1 id="g:4">Creating and looking up Ops</h1><div class="top"><p class="src"><a id="v:getOrAddOp" class="def">getOrAddOp</a> :: <a href="TensorFlow-Output.html#t:OpDef">OpDef</a> -> <a href="TensorFlow-Build.html#t:Build">Build</a> <a href="TensorFlow-Output.html#t:NodeName">NodeName</a> <a href="src/TensorFlow.Build.html#getOrAddOp" class="link">Source</a> <a href="#v:getOrAddOp" class="selflink">#</a></p><div class="doc"><p>Render the given op if it hasn't been rendered already, and return its
|
||
|
name.</p></div></div><div class="top"><p class="src"><a id="v:addNewOp" class="def">addNewOp</a> :: <a href="TensorFlow-Output.html#t:OpDef">OpDef</a> -> <a href="TensorFlow-Build.html#t:Build">Build</a> <a href="TensorFlow-Output.html#t:NodeName">NodeName</a> <a href="src/TensorFlow.Build.html#addNewOp" class="link">Source</a> <a href="#v:addNewOp" class="selflink">#</a></p><div class="doc"><p>Add a new node for a given <code><a href="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><div class="top"><p class="src"><a id="v:encodeOutput" class="def">encodeOutput</a> :: <a href="TensorFlow-Output.html#t:Output">Output</a> -> Text <a href="src/TensorFlow.Build.html#encodeOutput" class="link">Source</a> <a href="#v:encodeOutput" class="selflink">#</a></p><div class="doc"><p>Turn an <code><a href="TensorFlow-Output.html#t:Output">Output</a></code> into a string representation for the TensorFlow
|
||
|
foreign APIs.</p></div></div><div class="top"><p class="src"><a id="v:lookupNode" class="def">lookupNode</a> :: <a href="TensorFlow-Output.html#t:NodeName">NodeName</a> -> <a href="TensorFlow-Build.html#t:Build">Build</a> <a href="../tensorflow-proto-0.2.0.0/Proto-Tensorflow-Core-Framework-NodeDef.html#t:NodeDef">NodeDef</a> <a href="src/TensorFlow.Build.html#lookupNode" class="link">Source</a> <a href="#v:lookupNode" class="selflink">#</a></p></div><h1 id="g:5">Modifying all nodes in a Build action</h1><div class="top"><p class="src"><a id="v:withStateLens" class="def">withStateLens</a> :: <a href="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> m => Lens' <a href="TensorFlow-Build.html#t:GraphState">GraphState</a> a -> (a -> a) -> m b -> m b <a href="src/TensorFlow.Build.html#withStateLens" class="link">Source</a> <a href="#v:withStateLens" class="selflink">#</a></p><div class="doc"><p>Modify some part of the state, run an action, and restore the state
|
||
|
after that action is done.</p></div></div><div class="top"><p class="src"><a id="v:withDevice" class="def">withDevice</a> :: <a href="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> m => <a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="TensorFlow-Output.html#t:Device">Device</a> -> m a -> m a <a href="src/TensorFlow.Build.html#withDevice" class="link">Source</a> <a href="#v:withDevice" class="selflink">#</a></p><div class="doc"><p>Set a device for all nodes rendered in the given <code><a href="TensorFlow-Build.html#t:Build">Build</a></code> action
|
||
|
(unless further overridden by another use of withDevice).</p></div></div><div class="top"><p class="src"><a id="v:withNameScope" class="def">withNameScope</a> :: <a href="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> m => Text -> m a -> m a <a href="src/TensorFlow.Build.html#withNameScope" class="link">Source</a> <a href="#v:withNameScope" class="selflink">#</a></p><div class="doc"><p>Prepend a scope to all nodes rendered in the given <code><a href="TensorFlow-Build.html#t:Build">Build</a></code> action.</p></div></div><div class="top"><p class="src"><a id="v:withNodeDependencies" class="def">withNodeDependencies</a> :: <a href="TensorFlow-Build.html#t:MonadBuild">MonadBuild</a> m => <a href="../containers-0.5.10.2/Data-Set-Internal.html#t:Set">Set</a> <a href="TensorFlow-Output.html#t:NodeName">NodeName</a> -> m a -> m a <a href="src/TensorFlow.Build.html#withNodeDependencies" class="link">Source</a> <a href="#v:withNodeDependencies" class="selflink">#</a></p><div class="doc"><p>Add control inputs to all nodes rendered in the given <code><a href="TensorFlow-Build.html#t:Build">Build</a></code> action.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.18.1</p></div></body></html>
|