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

12 lines
50 KiB
HTML
Raw Normal View History

<!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 type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_TensorFlow-Types.html");};
//]]>
2017-04-08 16:14:47 +02:00
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><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.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.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"><li><a href="#v:tensorType">tensorType</a> :: a -&gt; <a href="TensorFlow-Types.html#t:DataType">DataType</a></li><li><a href="#v:tensorRefType">tensorRefType</a> :: a -&gt; <a href="TensorFlow-Types.html#t:DataType">DataType</a></li><li><a href="#v:tensorVal">tensorVal</a> :: Lens' <a href="../tensorflow-proto-0.1.0.0/Proto-Tensorflow-Core-Framework-Tensor.html#t:TensorProto">TensorProto</a> [a]</li></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"><li><a href="#v:decodeTensorData">decodeTensorData</a> :: <a href="TensorFlow-Types.html#t:TensorData">TensorData</a> a -&gt; s a</li><li><a href="#v:encodeTensorData">encodeTensorData</a> :: <a href="TensorFlow-Types.html#t:Shape">Shape</a> -&gt; s a -&gt; <a href="TensorFlow-Types.html#t:TensorData">TensorData</a> a</li></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.8.2.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"><li><a href="#v:attrLens">attrLens</a> :: Lens' <a href="../tensorflow-proto-0.1.0.0/Proto-Tensorflow-Core-Framework-AttrValue.html#t:AttrValue">AttrValue</a> a</li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:DataType">DataType</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_Q
element 1: index (0, ..., 1)
2017-04-08 16:14:47 +02:00
...</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"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../base-4.8.2.0/Prelude.html#t:Double">Double</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../base-4.8.2.0/Prelude.html#t:Float">Float</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../base-4.8.2.0/Data-Int.html#t:Int8">Int8</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../base-4.8.2.0/Data-Int.html#t:Int16">Int16</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../base-4.8.2.0/Data-Int.html#t:Int32">Int32</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../base-4.8.2.0/Data-Int.html#t:Int64">Int64</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../base-4.8.2.0/Data-Word.html#t:Word8">Word8</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../base-4.8.2.0/Data-Word.html#t:Word16">Word16</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left">(<a href="../base-4.8.2.0/Foreign-Storable.html#t:Storable">Storable</a> a, <a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector a) =&gt; <a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector a</span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector <a href="../bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector a =&gt; <a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> <a href="TensorFlow-Types.html#t:Scalar">Scalar</a> a</span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector (<a href="../base-4.8.2.0/Data-Complex.html#t:Complex">Complex</a> <a href="../base-4.8.2.0/Prelude.html#t:Double">Double</a>)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="TensorFlow-Types.html#t:TensorDataType">TensorDataType</a> Vector (<a href="../base-4.8.2.0/Data-Complex.html#t:Complex">Complex</a> <a href="../base-4.8.2.0/Prelude.html#t:Float">Float</a>)</span></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a name="t:Scalar" class="def">Scalar</a> a</p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:S
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; ...
2017-04-08 16:14:47 +02:00
</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 name="t:-47--61-" class="def">/=</a> b :: <a href="../base-4.8.2.0/GHC-Exts.html#t:Constraint">Constraint</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 name="t:OneOfs" class="def">OneOfs</a> ts as = (<a href="TensorFlow-Types.html#t:TensorTypes">TensorTypes</a> as, <a href="TensorFlow-Types.html#t:TensorTypes">TensorTypes</a> ts, NoneOfs (<a href="TensorFlow-Types.html#t:AllTensorTypes">AllTensorTypes</a> <a href="TensorFlow-Types.html#t:-92--92-">\\</a> ts) as)</p></div><h2 id="g:3">Implementation of constraints</h2><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:TypeError" class="def">TypeError</a> a</p><div class="doc"><p>Helper types to produce a reasonable type error message when the Constraint
&quot;a /= a&quot; fails.
2017-04-08 16:14:47 +02:00
TODO(judahjacobson): Use ghc-8's CustomTypeErrors for this.</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ExcludedCase" class="def">ExcludedCase</a></p></div><div class="top"><p class="src"><span class="keyword">type family</span> <a name="t:NoneOf" class="def">NoneOf</a> ts a :: <a href="../base-4.8.2.0/GHC-Exts.html#t:Constraint">Constraint</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 name="t:-92--92-" class="def">\\</a> bs</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 name="t:Delete" class="def">Delete</a> a as</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 name="t:AllTensorTypes" class="def">AllTensorTypes</a> = `[<a href="../base-4.8.2.0/Prelude.html#t:Float">Float</a>, <a href="../base-4.8.2.0/Prelude.html#t:Double">Double</a>, <a href="../base-4.8.2.0/Data-Int.html#t:Int8">Int8</a>, <a href="../base-4.8.2.0/Data-Int.html#t:Int16">Int16</a>, <a href="../base-4.8.2.0/Data-Int.html#t:Int32">Int32</a>, <a href="../base-4.8.2.0/Data-Int.html#t:Int64">Int64</a>, <a href="../base-4.8.2.0/Data-Word.html#t:Word8">Word8</a>, <a href="../base-4.8.2.0/Data-Word.html#t:Word16">Word16</a>, <a href="../bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="../base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>]`</p><div class="doc"><p>An enumeration of all valid <code><a href="TensorFlow-Types.html#t:TensorType">TensorType</a></code>s.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http:/