1
0
mirror of https://github.com/tensorflow/haskell.git synced 2024-07-03 18:03:29 +02:00
tensorflow-haskell/docs/haddock/tensorflow-0.1.0.2/TensorFlow-Types.html

12 lines
143 KiB
HTML
Raw Normal View History

2017-10-20 05:56:38 +02:00
<!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.Types</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_TensorFlow-Types.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/TensorFlow.Types.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.1.0.2: 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.Types</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Lists</a></li><li><a href="#g:2">Type constraints</a><ul><li><a href="#g:3">Implementation of constraints</a></li></ul></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">class</span> <a href="#t:TensorType">TensorType</a> a <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">newtype</span> <a href="#t:TensorData">TensorData</a> a = <a href="#v:TensorData">TensorData</a> {<ul class="subs"><li><a href="#v:unTensorData">unTensorData</a> :: <a href="TensorFlow-Internal-FFI.html#t:TensorData">TensorData</a></li></ul>}</li><li class="src short"><span class="keyword">class</span> <a href="TensorFlow-Types.html#t:TensorType">TensorType</a> a =&gt; <a href="#t:TensorDataType">TensorDataType</a> s a <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">newtype</span> <a href="#t:Scalar">Scalar</a> a = <a href="#v:Scalar">Scalar</a> {<ul class="subs"><li><a href="#v:unScalar">unScalar</a> :: a</li></ul>}</li><li class="src short"><span class="keyword">newtype</span> <a href="#t:Shape">Shape</a> = <a href="#v:Shape">Shape</a> [<a href="../base-4.9.1.0/Data-Int.html#t:Int64">Int64</a>]</li><li class="src short"><a href="#v:protoShape">protoShape</a> :: Lens' <a href="../tensorflow-proto-0.1.0.0/Proto-Tensorflow-Core-Framework-TensorShape.html#t:TensorShapeProto">TensorShapeProto</a> <a href="TensorFlow-Types.html#t:Shape">Shape</a></li><li class="src short"><span class="keyword">class</span> <a href="#t:Attribute">Attribute</a> a <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:DataType">DataType</a> :: <a href="../base-4.9.1.0/Data-Kind.html#t:-42-">*</a><ul class="subs"><li>= <a href="#v:DT_INVALID">DT_INVALID</a></li><li>| <a href="#v:DT_FLOAT">DT_FLOAT</a></li><li>| <a href="#v:DT_DOUBLE">DT_DOUBLE</a></li><li>| <a href="#v:DT_INT32">DT_INT32</a></li><li>| <a href="#v:DT_UINT8">DT_UINT8</a></li><li>| <a href="#v:DT_INT16">DT_INT16</a></li><li>| <a href="#v:DT_INT8">DT_INT8</a></li><li>| <a href="#v:DT_STRING">DT_STRING</a></li><li>| <a href="#v:DT_COMPLEX64">DT_COMPLEX64</a></li><li>| <a href="#v:DT_INT64">DT_INT64</a></li><li>| <a href="#v:DT_BOOL">DT_BOOL</a></li><li>| <a href="#v:DT_QINT8">DT_QINT8</a></li><li>| <a href="#v:DT_QUINT8">DT_QUINT8</a></li><li>| <a href="#v:DT_QINT32">DT_QINT32</a></li><li>| <a href="#v:DT_BFLOAT16">DT_BFLOAT16</a></li><li>| <a href="#v:DT_QINT16">DT_QINT16</a></li><li>| <a href="#v:DT_QUINT16">DT_QUINT16</a></li><li>| <a href="#v:DT_UINT16">DT_UINT16</a></li><li>| <a href="#v:DT_COMPLEX128">DT_COMPLEX128</a></li><li>| <a href="#v:DT_HALF">DT_HALF</a></li><li>| <a href="#v:DT_RESOURCE">DT_RESOURCE</a></li><li>| <a href="#v:DT_FLOAT_REF">DT_FLOAT_REF</a></li><li>| <a href="#v:DT_DOUBLE_REF">DT_DOUBLE_REF</a></li><li>| <a href="#v:DT_INT32_REF">DT_INT32_REF</a></li><li>| <a href="#v:DT_UINT8_REF">DT_UINT8_REF</a></li><li>| <a href="#v:DT_INT16_REF">DT_INT16_REF</a></li><li>| <a href="#v:DT_INT8_REF">DT_INT8_REF</a></li><li>| <a href="#v:DT_STRING_REF">DT_STRING_REF</a></li><li>| <a href="#v:DT_COMPLEX64_REF">DT_COMPLEX64_REF</a></li><li>| <a href="#v:DT_INT64_REF">DT_INT64_REF</a></li><li>| <a href="#v:DT_BOOL_REF">DT_BOOL_REF</a></li><li>| <a href="#v:DT_QINT8_REF">DT_QI
element 1: index (0, ..., 1)
...</p></div></div><div class="subs instances"><p id="control.i:TensorDataType" class="caption collapser" onclick="toggleSection('i:TensorDataType')">Instances</p><div id="section.i:TensorDataType" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:TensorDataType:TensorDataType:1" class="instance expander" onclick="toggleSection('i:ic:TensorDataType:TensorDataType:1')"></span> <a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></span> <a href="src/TensorFlow.Types.html#line-268" class="link">Source</a> <a href="#t:TensorDataType" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:TensorDataType:TensorDataType:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:decodeTensorData">decodeTensorData</a> :: <a href="TensorFlow-Types.html#t:TensorData">TensorData</a> <a href="../base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -&gt; Vector <a href="../base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/TensorFlow.Types.html#decodeTensorData" class="link">Source</a> <a href="#v:decodeTensorData" class="selflink">#</a></p><p class="src"><a href="#v:encodeTensorData">encodeTensorData</a> :: <a href="TensorFlow-Types.html#t:Shape">Shape</a> -&gt; Vector <a href="../base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="TensorFlow-Types.html#t:TensorData">TensorData</a> <a href="../base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/TensorFlow.Types.html#encodeTensorData" class="link">Source</a> <a href="#v:encodeTensorData" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:TensorDataType:TensorDataType:2" class="instance expander" onclick="toggleSection('i:ic:TensorDataType:TensorDataType:2')"></span> <a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../base-4.9.1.0/Prelude.html#t:Double">Double</a></span> <a href="src/TensorFlow.Types.html#line-238" class="link">Source</a> <a href="#t:TensorDataType" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:TensorDataType:TensorDataType:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:decodeTensorData">decodeTensorData</a> :: <a href="TensorFlow-Types.html#t:TensorData">TensorData</a> <a href="../base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; Vector <a href="../base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/TensorFlow.Types.html#decodeTensorData" class="link">Source</a> <a href="#v:decodeTensorData" class="selflink">#</a></p><p class="src"><a href="#v:encodeTensorData">encodeTensorData</a> :: <a href="TensorFlow-Types.html#t:Shape">Shape</a> -&gt; Vector <a href="../base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="TensorFlow-Types.html#t:TensorData">TensorData</a> <a href="../base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/TensorFlow.Types.html#encodeTensorData" class="link">Source</a> <a href="#v:encodeTensorData" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:TensorDataType:TensorDataType:3" class="instance expander" onclick="toggleSection('i:ic:TensorDataType:TensorDataType:3')"></span> <a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../base-4.9.1.0/Prelude.html#t:Float">Float</a></span> <a href="src/TensorFlow.Types.html#line-234" class="link">Source</a> <a href="#t:TensorDataType" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:TensorDataType:TensorDataType:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:decodeTensorData">decodeTensorData</a> :: <a href="TensorFlow-Types.html#t:TensorData">TensorData</a> <a href="../base-4.9.1.0/Pre
natural representation as a conjunction, i.e.,</p><pre> a == Double || a == Float
</pre><p>into a disjunction like</p><pre> a /= Int32 &amp;&amp; a /= Int64 &amp;&amp; a /= ByteString &amp;&amp; ...
</pre><p>using an enumeration of all the possible <code><a href="TensorFlow-Types.html#t:TensorType">TensorType</a></code>s.</p></div></div><div class="top"><p class="src"><span class="keyword">type family</span> a <a id="t:-47--61-" class="def">/=</a> b :: <a href="../base-4.9.1.0/Data-Kind.html#t:Constraint">Constraint</a> <span class="keyword">where ...</span> <a href="src/TensorFlow.Types.html#%2F%3D" class="link">Source</a> <a href="#t:-47--61-" class="selflink">#</a></p><div class="doc"><p>A constraint checking that two types are different.</p></div><div class="subs equations"><p class="caption">Equations</p><table><tr><td class="src">a <a href="TensorFlow-Types.html#t:-47--61-">/=</a> a = <a href="TensorFlow-Types.html#t:TypeError">TypeError</a> a ~ <a href="TensorFlow-Types.html#t:ExcludedCase">ExcludedCase</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">a <a href="TensorFlow-Types.html#t:-47--61-">/=</a> b = ()</td><td class="doc empty">&nbsp;</td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:OneOfs" class="def">OneOfs</a> ts as = (<a href="TensorFlow-Types.html#t:TensorTypes">TensorTypes</a> as, TensorTypes' ts, NoneOfs (<a href="TensorFlow-Types.html#t:AllTensorTypes">AllTensorTypes</a> <a href="TensorFlow-Types.html#t:-92--92-">\\</a> ts) as) <a href="src/TensorFlow.Types.html#OneOfs" class="link">Source</a> <a href="#t:OneOfs" class="selflink">#</a></p></div><h2 id="g:3">Implementation of constraints</h2><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:TypeError" class="def">TypeError</a> a <a href="src/TensorFlow.Types.html#TypeError" class="link">Source</a> <a href="#t:TypeError" class="selflink">#</a></p><div class="doc"><p>Helper types to produce a reasonable type error message when the Constraint
&quot;a /= a&quot; fails.
TODO(judahjacobson): Use ghc-8's CustomTypeErrors for this.</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:ExcludedCase" class="def">ExcludedCase</a> <a href="src/TensorFlow.Types.html#ExcludedCase" class="link">Source</a> <a href="#t:ExcludedCase" class="selflink">#</a></p></div><div class="top"><p class="src"><span class="keyword">type family</span> <a id="t:NoneOf" class="def">NoneOf</a> ts a :: <a href="../base-4.9.1.0/Data-Kind.html#t:Constraint">Constraint</a> <span class="keyword">where ...</span> <a href="src/TensorFlow.Types.html#NoneOf" class="link">Source</a> <a href="#t:NoneOf" class="selflink">#</a></p><div class="doc"><p>A constraint that the type <code>a</code> doesn't appear in the type list <code>ts</code>.
Assumes that <code>a</code> and each of the elements of <code>ts</code> are <code><a href="TensorFlow-Types.html#t:TensorType">TensorType</a></code>s.</p></div><div class="subs equations"><p class="caption">Equations</p><table><tr><td class="src"><a href="TensorFlow-Types.html#t:NoneOf">NoneOf</a> (t1 ': (t2 ': (t3 ': (t4 ': ts)))) a = (a <a href="TensorFlow-Types.html#t:-47--61-">/=</a> t1, a <a href="TensorFlow-Types.html#t:-47--61-">/=</a> t2, a <a href="TensorFlow-Types.html#t:-47--61-">/=</a> t3, a <a href="TensorFlow-Types.html#t:-47--61-">/=</a> t4, <a href="TensorFlow-Types.html#t:NoneOf">NoneOf</a> ts a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="TensorFlow-Types.html#t:NoneOf">NoneOf</a> (t1 ': (t2 ': (t3 ': ts))) a = (a <a href="TensorFlow-Types.html#t:-47--61-">/=</a> t1, a <a href="TensorFlow-Types.html#t:-47--61-">/=</a> t2, a <a href="TensorFlow-Types.html#t:-47--61-">/=</a> t3, <a href="TensorFlow-Types.html#t:NoneOf">NoneOf</a> ts a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="TensorFlow-Types.html#t:NoneOf">NoneOf</a> (t1 ': (t2 ': ts)) a = (a <a href="TensorFlow-Types.html#t:-47--61-">/=</a> t1, a <a href="TensorFlow-Types.html#t:-47--61-">/=</a> t2, <a href="TensorFlow-Types.html#t:NoneOf">NoneOf</a> ts a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="TensorFlow-Types.html#t:NoneOf">NoneOf</a> (t1 ': ts) a = (a <a href="TensorFlow-Types.html#t:-47--61-">/=</a> t1, <a href="TensorFlow-Types.html#t:NoneOf">NoneOf</a> ts a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="TensorFlow-Types.html#t:NoneOf">NoneOf</a> '[] a = ()</td><td class="doc empty">&nbsp;</td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">type family</span> as <a id="t:-92--92-" class="def">\\</a> bs <span class="keyword">where ...</span> <a href="src/TensorFlow.Types.html#%5C%5C" class="link">Source</a> <a href="#t:-92--92-" class="selflink">#</a></p><div class="doc"><p>Takes the difference of two lists of types.</p></div><div class="subs equations"><p class="caption">Equations</p><table><tr><td class="src">as <a href="TensorFlow-Types.html#t:-92--92-">\\</a> '[] = as</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">as <a href="TensorFlow-Types.html#t:-92--92-">\\</a> (b ': bs) = <a href="TensorFlow-Types.html#t:Delete">Delete</a> b as <a href="TensorFlow-Types.html#t:-92--92-">\\</a> bs</td><td class="doc empty">&nbsp;</td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">type family</span> <a id="t:Delete" class="def">Delete</a> a as <span class="keyword">where ...</span> <a href="src/TensorFlow.Types.html#Delete" class="link">Source</a> <a href="#t:Delete" class="selflink">#</a></p><div class="doc"><p>Removes a type from the given list of types.</p></div><div class="subs equations"><p class="caption">Equations</p><table><tr><td class="src"><a href="TensorFlow-Types.html#t:Delete">Delete</a> a '[] = '[]</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="TensorFlow-Types.html#t:Delete">Delete</a> a (a ': as) = <a href="TensorFlow-Types.html#t:Delete">Delete</a> a as</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="TensorFlow-Types.html#t:Delete">Delete</a> a (b ': as) = b ': <a href="TensorFlow-Types.html#t:Delete">Delete</a> a as</td><td class="doc empty">&nbsp;</td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:AllTensorTypes" class="def">AllTensorTypes</a> = '[<a href="../base-4.9.1.0/Prelude.html#t:Float">Float</a>, <a href="../base-4.9.1.0/Prelude.html#t:Double">Double</a>, <a href="../base-4.9.1.0/Data-Int.html#t:Int8">Int8</a>, <a href="../base-4.9.1.0/Data-Int.html#t:Int16">Int16</a>, <a href="../base-4.9.1.0/Data-Int.html#t:Int32">Int32</a>, <a href="../base-4.9.1.0/Data-Int.html#t:Int64">Int64</a>, <a href="../base-4.9.1.0/Data-Word.html#t:Word8">Word8</a>, <a href="../base-4.9.1.0/Data-Word.html#t:Word16">Word16</a>, <a href="../bytestring-0.10.8.1/Data-B