<!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.Core</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-Core.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.Core</p></div><divid="table-of-contents"><pclass="caption">Contents</p><ul><li><ahref="#g:1">Session</a><ul><li><ahref="#g:2">Building graphs</a></li><li><ahref="#g:3">Running graphs</a></li><li><ahref="#g:4">Async</a></li></ul></li><li><ahref="#g:5">Build</a></li><li><ahref="#g:6">Tensor</a><ul><li><ahref="#g:7">Element types</a></li></ul></li><li><ahref="#g:8">Op combinators</a><ul><li><ahref="#g:9">Dependencies</a></li><li><ahref="#g:10">Misc</a></li></ul></li></ul></div><divid="description"><pclass="caption">Description</p><divclass="doc"><p>The core functionality of TensorFlow.</p><p>Unless you are defining ops, you do not need to import other modules from
packages.</p></div></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">data</span><ahref="#t:Session">Session</a> a</li><liclass="src short"><spanclass="keyword">data</span><ahref="#t:Options">Options</a></li><liclass="src short"><ahref="#v:sessionConfig">sessionConfig</a> :: Lens' <ahref="TensorFlow-Core.html#t:Options">Options</a><ahref="../tensorflow-proto-0.1.0.0/Proto-Tensorflow-Core-Protobuf-Config.html#t:ConfigProto">ConfigProto</a></li><liclass="src short"><ahref="#v:sessionTarget">sessionTarget</a> :: Lens' <ahref="TensorFlow-Core.html#t:Options">Options</a><ahref="../bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></li><liclass="src short"><ahref="#v:sessionTracer">sessionTracer</a> :: Lens' <ahref="TensorFlow-Core.html#t:Options">Options</a> Tracer</li><liclass="src short"><ahref="#v:runSession">runSession</a> :: <ahref="TensorFlow-Core.html#t:Session">Session</a> a -><ahref="../base-4.8.2.0/System-IO.html#t:IO">IO</a> a</li><liclass="src short"><ahref="#v:runSessionWithOptions">runSessionWithOptions</a> :: <ahref="TensorFlow-Core.html#t:Options">Options</a> -><ahref="TensorFlow-Core.html#t:Session">Session</a> a -><ahref="../base-4.8.2.0/System-IO.html#t:IO">IO</a> 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-Core.html#t:Build">Build</a> a -> m a</li></ul></li><liclass="src short"><spanclass="keyword">class</span><ahref="TensorFlow-Core.html#t:Nodes">Nodes</a> t =><ahref="#t:Fetchable">Fetchable</a> t a</li><liclass="src short"><spanclass="keyword">class</span><ahref="#t:Nodes">Nodes</a> t</li><liclass="src short"><ahref="#v:run">run</a> :: <ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> t a => t -><ahref="TensorFlow-Core.html#t:Session">Session</a> a</li><liclass="src short"><ahref="#v:run_">run_</a> :: <ahref="TensorFlow-Core.html#t:Nodes">Nodes</a> t => t -><ahref="TensorFlow-Core.html#t:Session">Session</a> ()</li><liclass="src short"><spanclass="keyword">data</span><ahref="#t:Feed">Feed</a></li><liclass="src short"><ahref="#v:feed">feed</a> :: <ahref="TensorFlow-Tensor.html#t:Rendered">Rendered</a> v =><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a> v a -><ahref="TensorFlow-Core.html#t:TensorData">TensorData</a> a -><ahref="TensorFlow-Core.html#t:Feed">Feed</a></li><liclass="src short"><ahref="#v:runWithFeeds">runWithFeeds</a> :: <ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> t a => [<ahref="TensorFlow-Core.html#t:Feed">Feed</a>] -> t -><ahref="TensorFlow-Core.html#t:Session">Session</a> a</li><liclass="src short"><ahref="#v:runWithFeeds_">runWithFeeds_</a> :: <ahref="TensorFlow-Core.html#t:Nodes">Nodes</a> t => [<ahref="TensorFlow-Core.html#t:Feed">Feed</a>] -> t -><ahref="TensorFlow-Core.html#t:Session">Session</a> ()</li><liclass="src short"><ahref="#v:asyncProdNodes">asyncProdNodes</a> :: <ahref="TensorFlow-Core.html#t:Nodes">Nodes</a> t => t -><ahref="TensorFlow-Core.html#t:Session">Session</a> ()</li><liclass="src short"><spanclass="keyword">type</span><ahref="#t:Build">Build</a> = <ahref="TensorFlow-Core.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">data</span><ahref="#t:BuildT">BuildT</a> m a</li><liclass="src short"><ahref="#v:render">render</a> :: <ahref="TensorFlow-Core.html#t:MonadBuild">MonadBuild</a> m =><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a><ahref="TensorFlow-Core.html#t:Build">Build</a> a -> m (<ahref="TensorFlow-Core.html#t:Tensor">Tensor</a><ahref="TensorFlow-Core.html#t:
<code><ahref="TensorFlow-Core.html#v:sessionTarget">sessionTarget</a></code>, <code><ahref="TensorFlow-Core.html#v:sessionTracer">sessionTracer</a></code>, <code><ahref="TensorFlow-Core.html#v:sessionConfig">sessionConfig</a></code>.</p></div><divclass="subs instances"><pid="control.i:Options"class="caption collapser"onclick="toggleSection('i:Options')">Instances</p><divid="section.i:Options"class="show"><table><tr><tdclass="src clearfix"><spanclass="inst-left">Default <ahref="TensorFlow-Core.html#t:Options">Options</a></span></td><tdclass="doc empty"> </td></tr></table></div></div></div><divclass="top"><pclass="src"><aname="v:sessionConfig"class="def">sessionConfig</a> :: Lens' <ahref="TensorFlow-Core.html#t:Options">Options</a><ahref="../tensorflow-proto-0.1.0.0/Proto-Tensorflow-Core-Protobuf-Config.html#t:ConfigProto">ConfigProto</a></p><divclass="doc"><p>Uses the specified config for the created session.</p></div></div><divclass="top"><pclass="src"><aname="v:sessionTarget"class="def">sessionTarget</a> :: Lens' <ahref="TensorFlow-Core.html#t:Options">Options</a><ahref="../bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></p><divclass="doc"><p>Target can be: "local", ip:port, host:port.
The set of supported factories depends on the linked in libraries.</p></div></div><divclass="top"><pclass="src"><aname="v:sessionTracer"class="def">sessionTracer</a> :: Lens' <ahref="TensorFlow-Core.html#t:Options">Options</a> Tracer</p><divclass="doc"><p>Uses the given logger to monitor session progress.</p></div></div><divclass="top"><pclass="src"><aname="v:runSession"class="def">runSession</a> :: <ahref="TensorFlow-Core.html#t:Session">Session</a> a -><ahref="../base-4.8.2.0/System-IO.html#t:IO">IO</a> a</p><divclass="doc"><p>Run <code><ahref="TensorFlow-Core.html#t:Session">Session</a></code> actions in a new TensorFlow session.</p></div></div><divclass="top"><pclass="src"><aname="v:runSessionWithOptions"class="def">runSessionWithOptions</a> :: <ahref="TensorFlow-Core.html#t:Options">Options</a> -><ahref="TensorFlow-Core.html#t:Session">Session</a> a -><ahref="../base-4.8.2.0/System-IO.html#t:IO">IO</a> a</p><divclass="doc"><p>Run <code><ahref="TensorFlow-Core.html#t:Session">Session</a></code> actions in a new TensorFlow session created with
the given option setter actions (<code><ahref="TensorFlow-Core.html#v:sessionTarget">sessionTarget</a></code>, <code><ahref="TensorFlow-Core.html#v:sessionConfig">sessionConfig</a></code>).</p></div></div><h2id="g:2">Building graphs</h2><divclass="top"><pclass="src"><spanclass="keyword">class</span><ahref="../base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =><aname="t:MonadBuild"class="def">MonadBuild</a> m <spanclass="keyword">where</span></p><divclass="doc"><p>Lift a <code><ahref="TensorFlow-Core.html#t:Build">Build</a></code> action into a monad, including any explicit op renderings.</p></div><divclass="subs methods"><pclass="caption">Methods</p><pclass="src"><aname="v:build"class="def">build</a> :: <ahref="TensorFlow-Core.html#t:Build">Build</a> a -> m a</p></div><divclass="subs instances"><pid="control.i:MonadBuild"class="caption collapser"onclick="toggleSection('i:MonadBuild')">Instances</p><divid="section.i:MonadBuild"class="show"><table><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:MonadBuild">MonadBuild</a><ahref="TensorFlow-Core.html#t:Session">Session</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 =><ahref="TensorFlow-Core.html#t:MonadBuild">MonadBuild</a> (<ahref="TensorFlow-Core.html#t:BuildT">BuildT</a> m)</span></td><tdclass="doc empty"> </td></tr></table></div></div></div><h2id="g:3">Running graphs</h2><divclass="top"><pclass="src"><spanclass="keyword">class</span><ahref="TensorFlow-Core.html#t:Nodes">Nodes</a> t =><aname="t:Fetchable"class="def">Fetchable</a> t a</p><divclass="doc"><p>Types that tensor representations (e.g. <code><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a></code>, <code><ahref="TensorFlow-Core.html#t:ControlNode">ControlNode</a></code>) can be
fetched into.</p><p>Includes collections of tensors (e.g. tuples).</p></div><divclass="subs minimal"><pclass="caption">Minimal complete definition</p><pclass="src"><ahref="TensorFlow-Nodes.html#v:getFetch">getFetch</a></p></div><divclass="subs instances"><pid="control.i:Fetchable"class="caption collapser"onclick="toggleSection('i:Fetchable')">Instances</p><divid="section.i:Fetchable"class="show"><table><tr><tdclass="src clearfix"><spanclass="inst-left">(~) * a () =><ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a><ahref="TensorFlow-Core.html#t:ControlNode">ControlNode</a> a</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> t a =><ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> [t] [a]</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">(~) * l (<ahref="TensorFlow-Types.html#t:List">List</a> ([] *)) =><ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> (<ahref="TensorFlow-Types.html#t:ListOf">ListOf</a> f ([] *)) l</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">(<ahref="TensorFlow-Core.html#t:TensorType">TensorType</a> a, <ahref="TensorFlow-Core.html#t:TensorDataType">TensorDataType</a> s a, (~) * a a') =><ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> (<ahref="TensorFlow-Core.html#t:Tensor">Tensor</a> v a) (s a')</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">(<ahref="TensorFlow-Core.html#t:TensorType">TensorType</a> a, (~) * a a') =><ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> (<ahref="TensorFlow-Core.html#t:Tensor">Tensor</a> v a) (<ahref="TensorFlow-Core.html#t:TensorData">TensorData</a> a')</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">(<ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> t1 a1, <ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> t2 a2) =><ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> (t1, t2) (a1, a2)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">(<ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> (f t) a, <ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> (<ahref="TensorFlow-Types.html#t:ListOf">ListOf</a> f ts) (<ahref="TensorFlow-Types.html#t:List">List</a> as), (~) (* -> *) i <ahref="../base-4.8.2.0/Data-Functor-Identity.html#t:Identity">Identity</a>) =><ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> (<ahref="TensorFlow-Types.html#t:ListOf">ListOf</a> f ((:) * t ts)) (<ahref="TensorFlow-Types.html#t:ListOf">ListOf</a> i ((:) * a as))</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">(<ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> t1 a1, <ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> t2 a2, <ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> t3 a3) =><ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> (t1, t2, t3) (a1, a2, a3)</span></td><tdclass="doc empty"> </td></tr></table></div></div></div><divclass="top"><pclass="src"><spanclass="keyword">class</span><aname="t:Nodes"class="def">Nodes</a> t</p><divclass="doc"><p>Types that contain ops which can be run.</p></div><divclass="subs minimal"><pclass="caption">Minimal complete definition</p><pclass="src"><ahref="TensorFlow-Nodes.html#v:getNodes">getNodes</a></p></div><divclass="subs instances"><pid="control.i:Nodes"class="caption collapser"onclick="toggleSection('i:Nodes')">Instances</p><divid="section.i:Nodes"class="show"><table><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:Nodes">Nodes</a><ahref="TensorFlow-Core.html#t:ControlNode">ControlNode</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:Nodes">N
rendered, and fetch the corresponding values for <code>a</code>.</p></div></div><divclass="top"><pclass="src"><aname="v:run_"class="def">run_</a> :: <ahref="TensorFlow-Core.html#t:Nodes">Nodes</a> t => t -><ahref="TensorFlow-Core.html#t:Session">Session</a> ()</p><divclass="doc"><p>Run a subgraph <code>t</code>, rendering and extending any dependent nodes that aren't
fetches.</p></div></div><divclass="top"><pclass="src"><spanclass="keyword">data</span><aname="t:Feed"class="def">Feed</a></p><divclass="doc"><p>A pair of a <code><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a></code> and some data that should be fed into that <code><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a></code>
when running the graph.</p></div></div><divclass="top"><pclass="src"><aname="v:feed"class="def">feed</a> :: <ahref="TensorFlow-Tensor.html#t:Rendered">Rendered</a> v =><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a> v a -><ahref="TensorFlow-Core.html#t:TensorData">TensorData</a> a -><ahref="TensorFlow-Core.html#t:Feed">Feed</a></p><divclass="doc"><p>Create a <code><ahref="TensorFlow-Core.html#t:Feed">Feed</a></code> for feeding the given data into a <code><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a></code> when running
rendered <code><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a></code> may be different than feeding the original <code><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a></code>.</p></div></div><divclass="top"><pclass="src"><aname="v:runWithFeeds"class="def">runWithFeeds</a> :: <ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> t a => [<ahref="TensorFlow-Core.html#t:Feed">Feed</a>] -> t -><ahref="TensorFlow-Core.html#t:Session">Session</a> a</p><divclass="doc"><p>Run a subgraph <code>t</code>, rendering any dependent nodes that aren't already
values for <code>a</code>.</p></div></div><divclass="top"><pclass="src"><aname="v:runWithFeeds_"class="def">runWithFeeds_</a> :: <ahref="TensorFlow-Core.html#t:Nodes">Nodes</a> t => [<ahref="TensorFlow-Core.html#t:Feed">Feed</a>] -> t -><ahref="TensorFlow-Core.html#t:Session">Session</a> ()</p><divclass="doc"><p>Run a subgraph <code>t</code>, rendering any dependent nodes that aren't already
any fetches.</p></div></div><h2id="g:4">Async</h2><divclass="top"><pclass="src"><aname="v:asyncProdNodes"class="def">asyncProdNodes</a></p><divclass="subs arguments"><pclass="caption">Arguments</p><table><tr><tdclass="src">:: <ahref="TensorFlow-Core.html#t:Nodes">Nodes</a> t</td><tdclass="doc empty"> </td></tr><tr><tdclass="src">=> t</td><tdclass="doc"><p>Node to evaluate concurrently.</p></td></tr><tr><tdclass="src">-><ahref="TensorFlow-Core.html#t:Session">Session</a> ()</td><tdclass="doc empty"> </td></tr></table></div><divclass="doc"><p>Starts a concurrent thread which evaluates the given Nodes
a separate thread.</p></div></div><h1id="g:5">Build</h1><divclass="top"><pclass="src"><spanclass="keyword">type</span><aname="t:Build"class="def">Build</a> = <ahref="TensorFlow-Core.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><divclass="top"><pclass="src"><spanclass="keyword">data</span><aname="t:BuildT"class="def">BuildT</a> m a</p><divclass="doc"><p>An action for building nodes in a TensorFlow graph.
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-Core.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-Core.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-Core.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-Core.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-Core.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-Core.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-Core.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-Core.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-Core.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-Core.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-Core.html#t:MonadBuild">MonadBuild</a> (<ahref="TensorFlow-Core.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-Core.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-Core.html#t:Tensor">Tensor</a><ahref="TensorFlow-Core.html#t:Build">Build</a> a)</span></td><tdclass="doc empty"> </td></tr></table></div></div></div><divclass="top"><pclass="src"><aname="v:render"class="def">render</a> :: <ahref="TensorFlow-Core.html#t:MonadBuild">MonadBuild</a> m =><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a><ahref="TensorFlow-Core.html#t:Build">Build</a> a -> m (<ahref="TensorFlow-Core.html#t:Tensor">Tensor</a><ahref="TensorFlow-Core.html#t:Value">Value</
the <code><ahref="TensorFlow-Core.html#t:MonadBuild">MonadBuild</a></code> context. Also renders any dependencies of the <code><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a></code> that
weren't already rendered.</p><p>This operation is idempotent; calling <code><ahref="TensorFlow-Core.html#v:render">render</a></code> on the same input in the same
context will produce the same result. However, rendering the same
<code>Tensor Build</code> in two different contexts may result in two different
<code>Tensor Value</code>s.</p></div></div><divclass="top"><pclass="src"><aname="v:asGraphDef"class="def">asGraphDef</a> :: <ahref="TensorFlow-Core.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-Core.html#t:Build">Build</a></code> action.</p></div></div><divclass="top"><pclass="src"><aname="v:addGraphDef"class="def">addGraphDef</a> :: <ahref="TensorFlow-Core.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: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: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><h1id="g:6">Tensor</h1><divclass="top"><pclass="src"><spanclass="keyword">data</span><aname="t:ControlNode"class="def">ControlNode</a></p><divclass="doc"><p>A type of graph node which has no outputs. These nodes are
valuable for causing side effects when they are run.</p></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-Core.html#t:ControlNode">ControlNode</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:Nodes">Nodes</a><ahref="TensorFlow-Core.html#t:ControlNode">ControlNode</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">(~) * a () =><ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a><ahref="TensorFlow-Core.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:Tensor"class="def">Tensor</a> v a</p><divclass="doc"><p>A named output of a TensorFlow operation.</p><p>The type parameter <code>a</code> is the type of the elements in the <code><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a></code>. The
parameter <code>v</code> is either:</p><ul><li><code><ahref="TensorFlow-Core.html#t:Build">Build</a></code>: An unrendered, immutable value.</li><li><code><ahref="TensorFlow-Core.html#t:Value">Value</a></code>: A rendered, immutable value.</li><li><code><ahref="TensorFlow-Core.html#t:Ref">Ref</a></code>: A rendered stateful handle (e.g., a variable).</li></ul><p>Note that <code><ahref="TensorFlow-Core.html#v:expr">expr</a></code>, <code><ahref="TensorFlow-Core.html#v:value">value</a></code>, <code><ahref="TensorFlow-Core.html#v:render">render</a></code> and <code><ahref="TensorFlow-Tensor.html#v:renderValue">renderValue</a></code> can help convert between
the different types of <code><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a></code>.</p></div><divclass="subs instances"><pid="control.i:Tensor"class="caption collapser"onclick="toggleSection('i:Tensor')">Instances</p><divid="section.i:Tensor"class="show"><table><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-BuildOp.html#t:BuildInputs">BuildInputs</a> (<ahref="TensorFlow-Types.html#t:ListOf">ListOf</a> (<ahref="TensorFlow-Core.html#t:Tensor">Tensor</a> v) as)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-BuildOp.html#t:BuildInputs">BuildInputs</a> (<ahref="TensorFlow-Core.html#t:Tensor">Tensor</a> v a)</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-Core.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-Core.html#t:Tensor">Tensor</a><ahref="TensorFlow-Core.html#t:Build">Build</a> a)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">(<ahref="TensorFlow-Tensor.html#t:Rendered">Rendered</a> v, <ahref="TensorFlow-Types.html#t:TensorTypes">TensorTypes</a> as) =><ahref="TensorFlow-BuildOp.html#t:BuildResult">BuildResult</a> (<ahref="TensorFlow-Tensor.html#t:TensorList">TensorList</a> v as)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Tensor.html#t:Rendered">Rendered</a> v =><ahref="TensorFlow-BuildOp.html#t:BuildResult">BuildResult</a> (<ahref="TensorFlow-Core.html#t:Tensor">Tensor</a> v a)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:Nodes">Nodes</a> (<ahref="TensorFlow-Core.html#t:Tensor">Tensor</a> v a)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">(<ahref="TensorFlow-Core.html#t:TensorType">TensorType</a> a, <ahref="TensorFlow-Core.html#t:TensorDataType">TensorDataType</a> s a, (~) * a a') =><ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> (<ahref="TensorFlow-Core.html#t:Tensor">Tensor</a> v a) (s a')</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left">(<ahref="TensorFlow-Core.html#t:TensorType">TensorType</a> a, (~) * a a') =><ahref="TensorFlow-Core.html#t:Fetchable">Fetchable</a> (<ahref="TensorFlow-Core.html#t:Tensor">Tensor</a> v a) (<ahref="TensorFlow-Core.html#t:TensorData">TensorData</a> a')</span></td><tdclass="doc empty"> </td></tr></table></div></div></div><divclass="top"><pclass="src"><spanclass="keyword">data</span><aname="t:Value"class="def">Value</a> a</p><divclass="subs instances"><pid="control.i:Value"class="caption collapser"onclick="toggleSection('i:Value')">Instances</p><divid="section.i:Value"class="show"><table><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a><ahref="TensorFlow-Core.html#t:Value">Value</a></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><ahref="TensorFlow-Core.html#t:Value">Value</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Control-Applicative.html#t:Applicative">Applicative</a><ahref="TensorFlow-Core.html#t:Value">Value</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Tensor.html#t:TensorKind">TensorKind</a><ahref="TensorFl
in a <code>GraphDef</code> that was loaded via <code><ahref="TensorFlow-Core.html#v:addGraphDef">addGraphDef</a></code>.
TODO(judahjacobson): add more safety checks here.</p></div></div><divclass="top"><pclass="src"><aname="v:expr"class="def">expr</a> :: <ahref="TensorFlow-Tensor.html#t:TensorKind">TensorKind</a> v =><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a> v a -><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a><ahref="TensorFlow-Core.html#t:Build">Build</a> a</p></div><h2id="g:7">Element types</h2><divclass="top"><pclass="src"><spanclass="keyword">class</span><aname="t:TensorType"class="def">TensorType</a> a</p><divclass="doc"><p>The class of scalar types supported by tensorflow.</p></div><divclass="subs minimal"><pclass="caption">Minimal complete definition</p><pclass="src"><ahref="TensorFlow-Types.html#v:tensorType">tensorType</a>, <ahref="TensorFlow-Types.html#v:tensorRefType">tensorRefType</a>, <ahref="TensorFlow-Types.html#v:tensorVal">tensorVal</a></p></div><divclass="subs instances"><pid="control.i:TensorType"class="caption collapser"onclick="toggleSection('i:TensorType')">Instances</p><divid="section.i:TensorType"class="show"><table><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a><ahref="../base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a><ahref="../base-4.8.2.0/Prelude.html#t:Double">Double</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a><ahref="../base-4.8.2.0/Prelude.html#t:Float">Float</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a><ahref="../base-4.8.2.0/Data-Int.html#t:Int8">Int8</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a><ahref="../base-4.8.2.0/Data-Int.html#t:Int16">Int16</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a><ahref="../base-4.8.2.0/Data-Int.html#t:Int32">Int32</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a><ahref="../base-4.8.2.0/Data-Int.html#t:Int64">Int64</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a><ahref="../base-4.8.2.0/Data-Word.html#t:Word8">Word8</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a><ahref="../base-4.8.2.0/Data-Word.html#t:Word16">Word16</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a><ahref="../bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a> (<ahref="../base-4.8.2.0/Data-Complex.html#t:Complex">Complex</a><ahref="../base-4.8.2.0/Prelude.html#t:Double">Double</a>)</span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a> (<ahref="../base-4.8.2.0/Data-Complex.html#t:Complex">Complex</a><ahref="../base-4.8.2.0/Prelude.html#t:Float">Float</a>)</span></td><tdclass="doc empty"> </td></tr></table></div></div></div><divclass="top"><pclass="src"><spanclass="keyword">data</span><aname="t:TensorData"class="def">TensorData</a> a</p><divclass="doc"><p>Tensor data with the correct memory layout for tensor
</pre><p>using an enumeration of all the possible <code><ahref="TensorFlow-Core.html#t:TensorType">TensorType</a></code>s.</p></div></div><divclass="top"><pclass="src"><spanclass="keyword">type family</span> a <aname="t:-47--61-"class="def">/=</a> b :: <ahref="../base-4.8.2.0/GHC-Exts.html#t:Constraint">Constraint</a></p><divclass="doc"><p>A constraint checking that two types are different.</p></div><divclass="subs equations"><pclass="caption">Equations</p><table><tr><tdclass="src">a <ahref="TensorFlow-Core.html#t:-47--61-">/=</a> a = <ahref="TensorFlow-Types.html#t:TypeError">TypeError</a> a ~ <ahref="TensorFlow-Types.html#t:ExcludedCase">ExcludedCase</a></td><tdclass="doc empty"> </td></tr><tr><tdclass="src">a <ahref="TensorFlow-Core.html#t:-47--61-">/=</a> b = ()</td><tdclass="doc empty"> </td></tr></table></div></div><h1id="g:8">Op combinators</h1><divclass="top"><pclass="src"><aname="v:colocateWith"class="def">colocateWith</a> :: (<ahref="TensorFlow-Core.html#t:MonadBuild">MonadBuild</a> m, <ahref="TensorFlow-Tensor.html#t:Rendered">Rendered</a> v) =><ahref="TensorFlow-Core.html#t:Tensor">Tensor</a> v b -> m a -> m a</p><divclass="doc"><p>Places all nodes rendered in the given <code><ahref="TensorFlow-Core.html#t:Build">Build</a></code> action on the same
return would not have the desired effect.</p></div></div><divclass="top"><pclass="src"><spanclass="keyword">newtype</span><aname="t:Device"class="def">Device</a></p><divclass="doc"><p>A device that a node can be assigned to.
are constructed from job and replica names.</p></div><divclass="subs constructors"><pclass="caption">Constructors</p><table><tr><tdclass="src"><aname="v:Device"class="def">Device</a></td><tdclass="doc empty"> </td></tr><tr><tdcolspan="2"><divclass="subs fields"><pclass="caption">Fields</p><dl><dtclass="src"><aname="v:deviceName"class="def">deviceName</a> :: Text</dt><ddclass="doc empty"> </dd></dl><divclass="clear"></div></div></td></tr></table></div><divclass="subs instances"><pid="control.i:Device"class="caption collapser"onclick="toggleSection('i:Device')">Instances</p><divid="section.i:Device"class="show"><table><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a><ahref="TensorFlow-Core.html#t:Device">Device</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-Core.html#t:Device">Device</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Text-Show.html#t:Show">Show</a><ahref="TensorFlow-Core.html#t:Device">Device</a></span></td><tdclass="doc empty"> </td></tr><tr><tdclass="src clearfix"><spanclass="inst-left"><ahref="../base-4.8.2.0/Data-String.html#t:IsString">IsString</a><ahref="TensorFlow-Core.html#t:Device">Device</a></span></td><tdclass="doc empty"> </td></tr></table></div></div></div><divclass="top"><pclass="src"><aname="v:withDevice"class="def">withDevice</a> :: <ahref="TensorFlow-Core.html#t:MonadBuild">MonadBuild</a> m =><ahref="../base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a><ahref="TensorFlow-Core.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-Core.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-Core.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-Core.html#t:Build">Build</a></code> action.</p></div></div><h2id="g:9">Dependencies</h2><divclass="top"><pclass="src"><aname="v:withControlDependencies"class="def">withControlDependencies</a> :: (<ahref="TensorFlow-Core.html#t:MonadBuild">MonadBuild</a> m, <ahref="TensorFlow-Core.html#t:Nodes">Nodes</a> t) => t -> m a -> m a</p><divclass="doc"><p>Modify a <code><ahref="TensorFlow-Core.html#t:Build">Build</a></code> action, such that all new ops rendered in it will depend
on the nodes in the first argument.</p></div></div><divclass="top"><pclass="src"><aname="v:group"class="def">group</a> :: (<ahref="TensorFlow-Core.html#t:MonadBuild">MonadBuild</a> m, <ahref="TensorFlow-Core.html#t:Nodes">Nodes</a> t) => t -> m <ahref="TensorFlow-Core.html#t:ControlNode">ControlNode</a></p><divclass="doc"><p>Create an op that groups multiple operations.</p><p>When this op finishes, all ops in the input <code>n</code> have finished. This op has
no output.</p></div></div><h2id="g:10">Misc</h2><divclass="top"><pclass="src"><aname="v:noOp"class="def">noOp</a> :: <ahref="TensorFlow-Core.html#t:MonadBuild">MonadBuild</a> m => m <ahref="TensorFlow-Core.html#t:ControlNode">ControlNode</a></p><divclass="doc"><p>Does nothing. Only useful as a placeholder for control edges.</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>