mirror of
https://github.com/tensorflow/haskell.git
synced 2025-01-04 07:59:47 +01:00
6b19e54722
* Update README to refer to 2.3.0-gpu. * Remove old package documentation from haddock directory.
516 lines
No EOL
98 KiB
HTML
516 lines
No EOL
98 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><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">-- Copyright 2016 TensorFlow authors.</span><span>
|
|
</span><span id="line-2"></span><span class="hs-comment">--</span><span>
|
|
</span><span id="line-3"></span><span class="hs-comment">-- Licensed under the Apache License, Version 2.0 (the "License");</span><span>
|
|
</span><span id="line-4"></span><span class="hs-comment">-- you may not use this file except in compliance with the License.</span><span>
|
|
</span><span id="line-5"></span><span class="hs-comment">-- You may obtain a copy of the License at</span><span>
|
|
</span><span id="line-6"></span><span class="hs-comment">--</span><span>
|
|
</span><span id="line-7"></span><span class="hs-comment">-- http://www.apache.org/licenses/LICENSE-2.0</span><span>
|
|
</span><span id="line-8"></span><span class="hs-comment">--</span><span>
|
|
</span><span id="line-9"></span><span class="hs-comment">-- Unless required by applicable law or agreed to in writing, software</span><span>
|
|
</span><span id="line-10"></span><span class="hs-comment">-- distributed under the License is distributed on an "AS IS" BASIS,</span><span>
|
|
</span><span id="line-11"></span><span class="hs-comment">-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span><span>
|
|
</span><span id="line-12"></span><span class="hs-comment">-- See the License for the specific language governing permissions and</span><span>
|
|
</span><span id="line-13"></span><span class="hs-comment">-- limitations under the License.</span><span>
|
|
</span><span id="line-14"></span><span>
|
|
</span><span id="line-15"></span><span class="hs-pragma">{-# LANGUAGE DataKinds #-}</span><span>
|
|
</span><span id="line-16"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
|
|
</span><span id="line-17"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
|
|
</span><span id="line-18"></span><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
|
|
</span><span id="line-19"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
|
|
</span><span id="line-20"></span><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
|
|
</span><span id="line-21"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
|
|
</span><span id="line-22"></span><span class="hs-pragma">{-# LANGUAGE TypeOperators #-}</span><span>
|
|
</span><span id="line-23"></span><span class="hs-pragma">{-# LANGUAGE UndecidableInstances #-}</span><span> </span><span class="hs-comment">-- For Fetchable (TensorExpr a)</span><span>
|
|
</span><span id="line-24"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">TensorFlow.Nodes</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-25"></span><span>
|
|
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Control.Applicative</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">liftA2</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">liftA3</span></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.Functor.Identity</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Identity</span></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.Map.Strict</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Map</span></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.Set</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Set</span></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.Text</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Text</span></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Data.Map.Strict</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Map</span></span><span>
|
|
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Data.Set</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Set</span></span><span>
|
|
</span><span id="line-33"></span><span>
|
|
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="TensorFlow.Build.html"><span class="hs-identifier">TensorFlow.Build</span></a></span><span>
|
|
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="TensorFlow.Output.html"><span class="hs-identifier">TensorFlow.Output</span></a></span><span>
|
|
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="TensorFlow.Tensor.html"><span class="hs-identifier">TensorFlow.Tensor</span></a></span><span>
|
|
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="TensorFlow.Types.html"><span class="hs-identifier">TensorFlow.Types</span></a></span><span>
|
|
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="TensorFlow.Internal.FFI.html"><span class="hs-identifier">TensorFlow.Internal.FFI</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">FFI</span></span><span>
|
|
</span><span id="line-39"></span><span>
|
|
</span><span id="line-40"></span><span class="hs-comment">-- | Types that contain ops which can be run.</span><span>
|
|
</span><span id="line-41"></span><span class="hs-keyword">class</span><span> </span><span id="Nodes"><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-var">Nodes</span></a></span></span><span> </span><span id="local-6989586621679166546"><span class="annot"><a href="#local-6989586621679166546"><span class="hs-identifier hs-type">t</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-42"></span><span> </span><span id="getNodes"><span class="annot"><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-type">getNodes</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679166546"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Set</span></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-43"></span><span>
|
|
</span><span id="line-44"></span><span class="hs-comment">-- | Types that tensor representations (e.g. 'Tensor', 'ControlNode') can be</span><span>
|
|
</span><span id="line-45"></span><span class="hs-comment">-- fetched into.</span><span>
|
|
</span><span id="line-46"></span><span class="hs-comment">--</span><span>
|
|
</span><span id="line-47"></span><span class="hs-comment">-- Includes collections of tensors (e.g. tuples).</span><span>
|
|
</span><span id="line-48"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166534"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">=></span><span> </span><span id="Fetchable"><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-var">Fetchable</span></a></span></span><span> </span><span id="local-6989586621679166534"><span class="annot"><a href="#local-6989586621679166534"><span class="hs-identifier hs-type">t</span></a></span></span><span> </span><span id="local-6989586621679166533"><span class="annot"><a href="#local-6989586621679166533"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-49"></span><span> </span><span id="getFetch"><span class="annot"><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-type">getFetch</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679166534"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166533"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-50"></span><span>
|
|
</span><span id="line-51"></span><span class="hs-comment">-- | Fetch action. Keeps track of what needs to be fetched and how to decode</span><span>
|
|
</span><span id="line-52"></span><span class="hs-comment">-- the fetched data.</span><span>
|
|
</span><span id="line-53"></span><span class="hs-keyword">data</span><span> </span><span id="Fetch"><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-var">Fetch</span></a></span></span><span> </span><span id="local-6989586621679166590"><span class="annot"><a href="#local-6989586621679166590"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Fetch"><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-var">Fetch</span></a></span></span><span>
|
|
</span><span id="line-54"></span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- | Nodes to fetch</span><span>
|
|
</span><span id="line-55"></span><span> </span><span id="fetches"><span class="annot"><span class="annottext">Fetch a -> Set Text
|
|
</span><a href="TensorFlow.Nodes.html#fetches"><span class="hs-identifier hs-var hs-var">fetches</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Set</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Text</span></span><span>
|
|
</span><span id="line-56"></span><span> </span><span class="hs-comment">-- | Function to create an 'a' from the fetched data.</span><span>
|
|
</span><span id="line-57"></span><span> </span><span class="hs-special">,</span><span> </span><span id="fetchRestore"><span class="annot"><span class="annottext">Fetch a -> Map Text TensorData -> a
|
|
</span><a href="TensorFlow.Nodes.html#fetchRestore"><span class="hs-identifier hs-var hs-var">fetchRestore</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Map</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Text</span></span><span> </span><span class="annot"><a href="TensorFlow.Internal.FFI.html#TensorData"><span class="hs-identifier hs-type">FFI.TensorData</span></a></span><span> </span><span class="hs-glyph">-></span><span> </span><span class="annot"><a href="#local-6989586621679166590"><span class="hs-identifier hs-type">a</span></a></span><span>
|
|
</span><span id="line-58"></span><span> </span><span class="hs-special">}</span><span>
|
|
</span><span id="line-59"></span><span>
|
|
</span><span id="line-60"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679166427"><span class="annot"><span class="hs-identifier hs-type">Functor</span></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-61"></span><span> </span><span id="local-6989586621679166425"><span class="annot"><span class="annottext">fmap :: (a -> b) -> Fetch a -> Fetch b
|
|
</span><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></span></span><span> </span><span id="local-6989586621679166424"><span class="annot"><span class="annottext">f :: a -> b
|
|
</span><a href="#local-6989586621679166424"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span><span> </span><span id="local-6989586621679166423"><span class="annot"><span class="annottext">fetch :: Set Text
|
|
</span><a href="#local-6989586621679166423"><span class="hs-identifier hs-var">fetch</span></a></span></span><span> </span><span id="local-6989586621679166422"><span class="annot"><span class="annottext">restore :: Map Text TensorData -> a
|
|
</span><a href="#local-6989586621679166422"><span class="hs-identifier hs-var">restore</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set Text -> (Map Text TensorData -> b) -> Fetch b
|
|
forall a. Set Text -> (Map Text TensorData -> a) -> Fetch a
|
|
</span><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-var">Fetch</span></a></span><span> </span><span class="annot"><span class="annottext">Set Text
|
|
</span><a href="#local-6989586621679166423"><span class="hs-identifier hs-var">fetch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -> b
|
|
</span><a href="#local-6989586621679166424"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(a -> b) -> (Map Text TensorData -> a) -> Map Text TensorData -> b
|
|
forall b c a. (b -> c) -> (a -> b) -> a -> c
|
|
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">Map Text TensorData -> a
|
|
</span><a href="#local-6989586621679166422"><span class="hs-identifier hs-var">restore</span></a></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-62"></span><span>
|
|
</span><span id="line-63"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679166412"><span id="local-6989586621679166414"><span id="local-6989586621679166416"><span class="annot"><span class="hs-identifier hs-type">Applicative</span></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-64"></span><span> </span><span id="local-6989586621679166410"><span class="annot"><span class="annottext">pure :: a -> Fetch a
|
|
</span><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></span></span><span> </span><span id="local-6989586621679166409"><span class="annot"><span class="annottext">x :: a
|
|
</span><a href="#local-6989586621679166409"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set Text -> (Map Text TensorData -> a) -> Fetch a
|
|
forall a. Set Text -> (Map Text TensorData -> a) -> Fetch a
|
|
</span><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-var">Fetch</span></a></span><span> </span><span class="annot"><span class="annottext">Set Text
|
|
forall a. Set a
|
|
</span><span class="hs-identifier hs-var">Set.empty</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -> Map Text TensorData -> a
|
|
forall a b. a -> b -> a
|
|
</span><span class="hs-identifier hs-var">const</span></span><span> </span><span class="annot"><span class="annottext">a
|
|
</span><a href="#local-6989586621679166409"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-65"></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span><span> </span><span id="local-6989586621679166406"><span class="annot"><span class="annottext">fetch :: Set Text
|
|
</span><a href="#local-6989586621679166406"><span class="hs-identifier hs-var">fetch</span></a></span></span><span> </span><span id="local-6989586621679166405"><span class="annot"><span class="annottext">restore :: Map Text TensorData -> a -> b
|
|
</span><a href="#local-6989586621679166405"><span class="hs-identifier hs-var">restore</span></a></span></span><span> </span><span id="local-6989586621679166404"><span class="annot"><span class="annottext"><*> :: Fetch (a -> b) -> Fetch a -> Fetch b
|
|
</span><span class="hs-operator hs-var hs-var hs-var hs-var"><*></span></span></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span><span> </span><span id="local-6989586621679166403"><span class="annot"><span class="annottext">fetch' :: Set Text
|
|
</span><a href="#local-6989586621679166403"><span class="hs-identifier hs-var">fetch'</span></a></span></span><span> </span><span id="local-6989586621679166402"><span class="annot"><span class="annottext">restore' :: Map Text TensorData -> a
|
|
</span><a href="#local-6989586621679166402"><span class="hs-identifier hs-var">restore'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
|
|
</span><span id="line-66"></span><span> </span><span class="annot"><span class="annottext">Set Text -> (Map Text TensorData -> b) -> Fetch b
|
|
forall a. Set Text -> (Map Text TensorData -> a) -> Fetch a
|
|
</span><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-var">Fetch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set Text
|
|
</span><a href="#local-6989586621679166406"><span class="hs-identifier hs-var">fetch</span></a></span><span> </span><span class="annot"><span class="annottext">Set Text -> Set Text -> Set Text
|
|
forall a. Semigroup a => a -> a -> a
|
|
</span><span class="hs-operator hs-var"><></span></span><span> </span><span class="annot"><span class="annottext">Set Text
|
|
</span><a href="#local-6989586621679166403"><span class="hs-identifier hs-var">fetch'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Map Text TensorData -> a -> b
|
|
</span><a href="#local-6989586621679166405"><span class="hs-identifier hs-var">restore</span></a></span><span> </span><span class="annot"><span class="annottext">(Map Text TensorData -> a -> b)
|
|
-> (Map Text TensorData -> a) -> Map Text TensorData -> b
|
|
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
|
|
</span><span class="hs-operator hs-var"><*></span></span><span> </span><span class="annot"><span class="annottext">Map Text TensorData -> a
|
|
</span><a href="#local-6989586621679166402"><span class="hs-identifier hs-var">restore'</span></a></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-67"></span><span>
|
|
</span><span id="line-68"></span><span id="local-6989586621679166543"><span id="local-6989586621679166544"><span id="local-6989586621679166545"><span class="annot"><a href="TensorFlow.Nodes.html#nodesUnion"><span class="hs-identifier hs-type">nodesUnion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Monoid</span></span><span> </span><span class="annot"><a href="#local-6989586621679166545"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Traversable</span></span><span> </span><span class="annot"><a href="#local-6989586621679166544"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Applicative</span></span><span> </span><span class="annot"><a href="#local-6989586621679166543"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="#local-6989586621679166544"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166543"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166545"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="annot"><a href="#local-6989586621679166543"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166545"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
|
|
</span><span id="line-69"></span><span id="nodesUnion"><span class="annot"><span class="annottext">nodesUnion :: t (f b) -> f b
|
|
</span><a href="TensorFlow.Nodes.html#nodesUnion"><span class="hs-identifier hs-var hs-var">nodesUnion</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(t b -> b) -> f (t b) -> f b
|
|
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
|
|
</span><span class="hs-identifier hs-var">fmap</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b -> b) -> t b -> b
|
|
forall (t :: * -> *) m a.
|
|
(Foldable t, Monoid m) =>
|
|
(a -> m) -> t a -> m
|
|
</span><span class="hs-identifier hs-var">foldMap</span></span><span> </span><span class="annot"><span class="annottext">b -> b
|
|
forall a. a -> a
|
|
</span><span class="hs-identifier hs-var">id</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(f (t b) -> f b) -> (t (f b) -> f (t b)) -> t (f b) -> f b
|
|
forall b c a. (b -> c) -> (a -> b) -> a -> c
|
|
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">t (f b) -> f (t b)
|
|
forall (t :: * -> *) (f :: * -> *) a.
|
|
(Traversable t, Applicative f) =>
|
|
t (f a) -> f (t a)
|
|
</span><span class="hs-identifier hs-var">sequenceA</span></span><span>
|
|
</span><span id="line-70"></span><span>
|
|
</span><span id="line-71"></span><span id="local-6989586621679166396"><span id="local-6989586621679166397"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166397"><span class="hs-identifier hs-type">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166396"><span class="hs-identifier hs-type">t2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166397"><span class="hs-identifier hs-type">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166396"><span class="hs-identifier hs-type">t2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-72"></span><span> </span><span id="local-6989586621679166393"><span class="annot"><span class="annottext">getNodes :: (t1, t2) -> Build (Set NodeName)
|
|
</span><a href="#local-6989586621679166393"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679166392"><span class="annot"><span class="annottext">x :: t1
|
|
</span><a href="#local-6989586621679166392"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679166391"><span class="annot"><span class="annottext">y :: t2
|
|
</span><a href="#local-6989586621679166391"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Build (Set NodeName)] -> Build (Set NodeName)
|
|
forall b (t :: * -> *) (f :: * -> *).
|
|
(Monoid b, Traversable t, Applicative f) =>
|
|
t (f b) -> f b
|
|
</span><a href="TensorFlow.Nodes.html#nodesUnion"><span class="hs-identifier hs-var">nodesUnion</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">t1 -> Build (Set NodeName)
|
|
forall t. Nodes t => t -> Build (Set NodeName)
|
|
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">t1
|
|
</span><a href="#local-6989586621679166392"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">t2 -> Build (Set NodeName)
|
|
forall t. Nodes t => t -> Build (Set NodeName)
|
|
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">t2
|
|
</span><a href="#local-6989586621679166391"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">]</span></span></span><span>
|
|
</span><span id="line-73"></span><span>
|
|
</span><span id="line-74"></span><span id="local-6989586621679166388"><span id="local-6989586621679166389"><span id="local-6989586621679166390"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166390"><span class="hs-identifier hs-type">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166389"><span class="hs-identifier hs-type">t2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166388"><span class="hs-identifier hs-type">t3</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166390"><span class="hs-identifier hs-type">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166389"><span class="hs-identifier hs-type">t2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166388"><span class="hs-identifier hs-type">t3</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-75"></span><span> </span><span id="local-6989586621679166386"><span class="annot"><span class="annottext">getNodes :: (t1, t2, t3) -> Build (Set NodeName)
|
|
</span><a href="#local-6989586621679166386"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679166385"><span class="annot"><span class="annottext">x :: t1
|
|
</span><a href="#local-6989586621679166385"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679166384"><span class="annot"><span class="annottext">y :: t2
|
|
</span><a href="#local-6989586621679166384"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679166383"><span class="annot"><span class="annottext">z :: t3
|
|
</span><a href="#local-6989586621679166383"><span class="hs-identifier hs-var">z</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Build (Set NodeName)] -> Build (Set NodeName)
|
|
forall b (t :: * -> *) (f :: * -> *).
|
|
(Monoid b, Traversable t, Applicative f) =>
|
|
t (f b) -> f b
|
|
</span><a href="TensorFlow.Nodes.html#nodesUnion"><span class="hs-identifier hs-var">nodesUnion</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">t1 -> Build (Set NodeName)
|
|
forall t. Nodes t => t -> Build (Set NodeName)
|
|
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">t1
|
|
</span><a href="#local-6989586621679166385"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">t2 -> Build (Set NodeName)
|
|
forall t. Nodes t => t -> Build (Set NodeName)
|
|
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">t2
|
|
</span><a href="#local-6989586621679166384"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">t3 -> Build (Set NodeName)
|
|
forall t. Nodes t => t -> Build (Set NodeName)
|
|
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">t3
|
|
</span><a href="#local-6989586621679166383"><span class="hs-identifier hs-var">z</span></a></span><span class="hs-special">]</span></span></span></span><span>
|
|
</span><span id="line-76"></span><span>
|
|
</span><span id="line-77"></span><span id="local-6989586621679166379"><span id="local-6989586621679166380"><span id="local-6989586621679166381"><span id="local-6989586621679166382"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166382"><span class="hs-identifier hs-type">t1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166381"><span class="hs-identifier hs-type">a1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166380"><span class="hs-identifier hs-type">t2</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166379"><span class="hs-identifier hs-type">a2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166382"><span class="hs-identifier hs-type">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166380"><span class="hs-identifier hs-type">t2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166381"><span class="hs-identifier hs-type">a1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166379"><span class="hs-identifier hs-type">a2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-78"></span><span> </span><span id="local-6989586621679166375"><span class="annot"><span class="annottext">getFetch :: (t1, t2) -> Build (Fetch (a1, a2))
|
|
</span><a href="#local-6989586621679166375"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679166374"><span class="annot"><span class="annottext">x :: t1
|
|
</span><a href="#local-6989586621679166374"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679166373"><span class="annot"><span class="annottext">y :: t2
|
|
</span><a href="#local-6989586621679166373"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a1 -> a2 -> (a1, a2)) -> Fetch a1 -> Fetch a2 -> Fetch (a1, a2)
|
|
forall (f :: * -> *) a b c.
|
|
Applicative f =>
|
|
(a -> b -> c) -> f a -> f b -> f c
|
|
</span><span class="hs-identifier hs-var">liftA2</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Fetch a1 -> Fetch a2 -> Fetch (a1, a2))
|
|
-> BuildT Identity (Fetch a1)
|
|
-> BuildT Identity (Fetch a2 -> Fetch (a1, a2))
|
|
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
|
|
</span><span class="hs-operator hs-var"><$></span></span><span> </span><span class="annot"><span class="annottext">t1 -> BuildT Identity (Fetch a1)
|
|
forall t a. Fetchable t a => t -> Build (Fetch a)
|
|
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">t1
|
|
</span><a href="#local-6989586621679166374"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">BuildT Identity (Fetch a2 -> Fetch (a1, a2))
|
|
-> BuildT Identity (Fetch a2) -> Build (Fetch (a1, a2))
|
|
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
|
|
</span><span class="hs-operator hs-var"><*></span></span><span> </span><span class="annot"><span class="annottext">t2 -> BuildT Identity (Fetch a2)
|
|
forall t a. Fetchable t a => t -> Build (Fetch a)
|
|
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">t2
|
|
</span><a href="#local-6989586621679166373"><span class="hs-identifier hs-var">y</span></a></span></span></span></span></span><span>
|
|
</span><span id="line-79"></span><span>
|
|
</span><span id="line-80"></span><span id="local-6989586621679166366"><span id="local-6989586621679166367"><span id="local-6989586621679166368"><span id="local-6989586621679166369"><span id="local-6989586621679166370"><span id="local-6989586621679166371"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166371"><span class="hs-identifier hs-type">t1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166370"><span class="hs-identifier hs-type">a1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166369"><span class="hs-identifier hs-type">t2</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166368"><span class="hs-identifier hs-type">a2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166367"><span class="hs-identifier hs-type">t3</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166366"><span class="hs-identifier hs-type">a3</span></a></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-81"></span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166371"><span class="hs-identifier hs-type">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166369"><span class="hs-identifier hs-type">t2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166367"><span class="hs-identifier hs-type">t3</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166370"><span class="hs-identifier hs-type">a1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166368"><span class="hs-identifier hs-type">a2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166366"><span class="hs-identifier hs-type">a3</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-82"></span><span> </span><span id="local-6989586621679166363"><span class="annot"><span class="annottext">getFetch :: (t1, t2, t3) -> Build (Fetch (a1, a2, a3))
|
|
</span><a href="#local-6989586621679166363"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679166362"><span class="annot"><span class="annottext">x :: t1
|
|
</span><a href="#local-6989586621679166362"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679166361"><span class="annot"><span class="annottext">y :: t2
|
|
</span><a href="#local-6989586621679166361"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679166360"><span class="annot"><span class="annottext">z :: t3
|
|
</span><a href="#local-6989586621679166360"><span class="hs-identifier hs-var">z</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
|
|
</span><span id="line-83"></span><span> </span><span class="annot"><span class="annottext">(a1 -> a2 -> a3 -> (a1, a2, a3))
|
|
-> Fetch a1 -> Fetch a2 -> Fetch a3 -> Fetch (a1, a2, a3)
|
|
forall (f :: * -> *) a b c d.
|
|
Applicative f =>
|
|
(a -> b -> c -> d) -> f a -> f b -> f c -> f d
|
|
</span><span class="hs-identifier hs-var">liftA3</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Fetch a1 -> Fetch a2 -> Fetch a3 -> Fetch (a1, a2, a3))
|
|
-> BuildT Identity (Fetch a1)
|
|
-> BuildT Identity (Fetch a2 -> Fetch a3 -> Fetch (a1, a2, a3))
|
|
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
|
|
</span><span class="hs-operator hs-var"><$></span></span><span> </span><span class="annot"><span class="annottext">t1 -> BuildT Identity (Fetch a1)
|
|
forall t a. Fetchable t a => t -> Build (Fetch a)
|
|
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">t1
|
|
</span><a href="#local-6989586621679166362"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">BuildT Identity (Fetch a2 -> Fetch a3 -> Fetch (a1, a2, a3))
|
|
-> BuildT Identity (Fetch a2)
|
|
-> BuildT Identity (Fetch a3 -> Fetch (a1, a2, a3))
|
|
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
|
|
</span><span class="hs-operator hs-var"><*></span></span><span> </span><span class="annot"><span class="annottext">t2 -> BuildT Identity (Fetch a2)
|
|
forall t a. Fetchable t a => t -> Build (Fetch a)
|
|
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">t2
|
|
</span><a href="#local-6989586621679166361"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">BuildT Identity (Fetch a3 -> Fetch (a1, a2, a3))
|
|
-> BuildT Identity (Fetch a3) -> Build (Fetch (a1, a2, a3))
|
|
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
|
|
</span><span class="hs-operator hs-var"><*></span></span><span> </span><span class="annot"><span class="annottext">t3 -> BuildT Identity (Fetch a3)
|
|
forall t a. Fetchable t a => t -> Build (Fetch a)
|
|
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">t3
|
|
</span><a href="#local-6989586621679166360"><span class="hs-identifier hs-var">z</span></a></span></span></span></span></span></span></span><span>
|
|
</span><span id="line-84"></span><span>
|
|
</span><span id="line-85"></span><span id="local-6989586621679166359"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166359"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679166359"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-86"></span><span> </span><span id="local-6989586621679166357"><span class="annot"><span class="annottext">getNodes :: [t] -> Build (Set NodeName)
|
|
</span><a href="#local-6989586621679166357"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Build (Set NodeName)] -> Build (Set NodeName)
|
|
forall b (t :: * -> *) (f :: * -> *).
|
|
(Monoid b, Traversable t, Applicative f) =>
|
|
t (f b) -> f b
|
|
</span><a href="TensorFlow.Nodes.html#nodesUnion"><span class="hs-identifier hs-var">nodesUnion</span></a></span><span> </span><span class="annot"><span class="annottext">([Build (Set NodeName)] -> Build (Set NodeName))
|
|
-> ([t] -> [Build (Set NodeName)]) -> [t] -> Build (Set NodeName)
|
|
forall b c a. (b -> c) -> (a -> b) -> a -> c
|
|
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">(t -> Build (Set NodeName)) -> [t] -> [Build (Set NodeName)]
|
|
forall a b. (a -> b) -> [a] -> [b]
|
|
</span><span class="hs-identifier hs-var">map</span></span><span> </span><span class="annot"><span class="annottext">t -> Build (Set NodeName)
|
|
forall t. Nodes t => t -> Build (Set NodeName)
|
|
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span></span><span>
|
|
</span><span id="line-87"></span><span>
|
|
</span><span id="line-88"></span><span id="local-6989586621679166355"><span id="local-6989586621679166356"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166356"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166355"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679166356"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679166355"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-89"></span><span> </span><span id="local-6989586621679166352"><span class="annot"><span class="annottext">getFetch :: [t] -> Build (Fetch [a])
|
|
</span><a href="#local-6989586621679166352"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span id="local-6989586621679166351"><span class="annot"><span class="annottext">ts :: [t]
|
|
</span><a href="#local-6989586621679166351"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Fetch a] -> Fetch [a]
|
|
forall (t :: * -> *) (f :: * -> *) a.
|
|
(Traversable t, Applicative f) =>
|
|
t (f a) -> f (t a)
|
|
</span><span class="hs-identifier hs-var">sequenceA</span></span><span> </span><span class="annot"><span class="annottext">([Fetch a] -> Fetch [a])
|
|
-> BuildT Identity [Fetch a] -> Build (Fetch [a])
|
|
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
|
|
</span><span class="hs-operator hs-var"><$></span></span><span> </span><span class="annot"><span class="annottext">(t -> BuildT Identity (Fetch a))
|
|
-> [t] -> BuildT Identity [Fetch a]
|
|
forall (t :: * -> *) (m :: * -> *) a b.
|
|
(Traversable t, Monad m) =>
|
|
(a -> m b) -> t a -> m (t b)
|
|
</span><span class="hs-identifier hs-var">mapM</span></span><span> </span><span class="annot"><span class="annottext">t -> BuildT Identity (Fetch a)
|
|
forall t a. Fetchable t a => t -> Build (Fetch a)
|
|
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">[t]
|
|
</span><a href="#local-6989586621679166351"><span class="hs-identifier hs-var">ts</span></a></span></span></span><span>
|
|
</span><span id="line-90"></span><span>
|
|
</span><span id="line-91"></span><span id="local-6989586621679166349"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166349"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Maybe</span></span><span> </span><span class="annot"><a href="#local-6989586621679166349"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-92"></span><span> </span><span id="local-6989586621679166347"><span class="annot"><span class="annottext">getNodes :: Maybe t -> Build (Set NodeName)
|
|
</span><a href="#local-6989586621679166347"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Build (Set NodeName)) -> Build (Set NodeName)
|
|
forall b (t :: * -> *) (f :: * -> *).
|
|
(Monoid b, Traversable t, Applicative f) =>
|
|
t (f b) -> f b
|
|
</span><a href="TensorFlow.Nodes.html#nodesUnion"><span class="hs-identifier hs-var">nodesUnion</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Build (Set NodeName)) -> Build (Set NodeName))
|
|
-> (Maybe t -> Maybe (Build (Set NodeName)))
|
|
-> Maybe t
|
|
-> Build (Set NodeName)
|
|
forall b c a. (b -> c) -> (a -> b) -> a -> c
|
|
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">(t -> Build (Set NodeName))
|
|
-> Maybe t -> Maybe (Build (Set NodeName))
|
|
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
|
|
</span><span class="hs-identifier hs-var">fmap</span></span><span> </span><span class="annot"><span class="annottext">t -> Build (Set NodeName)
|
|
forall t. Nodes t => t -> Build (Set NodeName)
|
|
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span></span><span>
|
|
</span><span id="line-93"></span><span>
|
|
</span><span id="line-94"></span><span id="local-6989586621679166345"><span id="local-6989586621679166346"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166346"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166345"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Maybe</span></span><span> </span><span class="annot"><a href="#local-6989586621679166346"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Maybe</span></span><span> </span><span class="annot"><a href="#local-6989586621679166345"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-95"></span><span> </span><span id="local-6989586621679166342"><span class="annot"><span class="annottext">getFetch :: Maybe t -> Build (Fetch (Maybe a))
|
|
</span><a href="#local-6989586621679166342"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Maybe (Fetch a) -> Fetch (Maybe a))
|
|
-> BuildT Identity (Maybe (Fetch a)) -> Build (Fetch (Maybe a))
|
|
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
|
|
</span><span class="hs-identifier hs-var">fmap</span></span><span> </span><span class="annot"><span class="annottext">Maybe (Fetch a) -> Fetch (Maybe a)
|
|
forall (t :: * -> *) (f :: * -> *) a.
|
|
(Traversable t, Applicative f) =>
|
|
t (f a) -> f (t a)
|
|
</span><span class="hs-identifier hs-var">sequenceA</span></span><span> </span><span class="annot"><span class="annottext">(BuildT Identity (Maybe (Fetch a)) -> Build (Fetch (Maybe a)))
|
|
-> (Maybe t -> BuildT Identity (Maybe (Fetch a)))
|
|
-> Maybe t
|
|
-> Build (Fetch (Maybe a))
|
|
forall b c a. (b -> c) -> (a -> b) -> a -> c
|
|
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">(t -> BuildT Identity (Fetch a))
|
|
-> Maybe t -> BuildT Identity (Maybe (Fetch a))
|
|
forall (t :: * -> *) (m :: * -> *) a b.
|
|
(Traversable t, Monad m) =>
|
|
(a -> m b) -> t a -> m (t b)
|
|
</span><span class="hs-identifier hs-var">mapM</span></span><span> </span><span class="annot"><span class="annottext">t -> BuildT Identity (Fetch a)
|
|
forall t a. Fetchable t a => t -> Build (Fetch a)
|
|
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span></span></span><span>
|
|
</span><span id="line-96"></span><span>
|
|
</span><span id="line-97"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#ControlNode"><span class="hs-identifier hs-type">ControlNode</span></a></span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-98"></span><span> </span><span id="local-6989586621679166340"><span class="annot"><span class="annottext">getNodes :: ControlNode -> Build (Set NodeName)
|
|
</span><a href="#local-6989586621679166340"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Output.html#ControlNode"><span class="hs-identifier hs-type">ControlNode</span></a></span><span> </span><span id="local-6989586621679166338"><span class="annot"><span class="annottext">o :: NodeName
|
|
</span><a href="#local-6989586621679166338"><span class="hs-identifier hs-var">o</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set NodeName -> Build (Set NodeName)
|
|
forall (f :: * -> *) a. Applicative f => a -> f a
|
|
</span><span class="hs-identifier hs-var">pure</span></span><span> </span><span class="annot"><span class="annottext">(Set NodeName -> Build (Set NodeName))
|
|
-> Set NodeName -> Build (Set NodeName)
|
|
forall a b. (a -> b) -> a -> b
|
|
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">NodeName -> Set NodeName
|
|
forall a. a -> Set a
|
|
</span><span class="hs-identifier hs-var">Set.singleton</span></span><span> </span><span class="annot"><span class="annottext">NodeName
|
|
</span><a href="#local-6989586621679166338"><span class="hs-identifier hs-var">o</span></a></span><span>
|
|
</span><span id="line-99"></span><span>
|
|
</span><span id="line-100"></span><span class="hs-comment">-- We use the constraint @(a ~ ())@ to help with type inference. For example,</span><span>
|
|
</span><span id="line-101"></span><span class="hs-comment">-- if @t :: ControlNode@, then this constraint ensures that @run t :: Session</span><span>
|
|
</span><span id="line-102"></span><span class="hs-comment">-- ()@. If we used @instance Fetchable ControlNode ()@ instead, then that</span><span>
|
|
</span><span id="line-103"></span><span class="hs-comment">-- expression would be ambiguous without explicitly specifying the return type.</span><span>
|
|
</span><span id="line-104"></span><span id="local-6989586621679166336"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="#local-6989586621679166336"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><span class="hs-glyph hs-type">~</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#ControlNode"><span class="hs-identifier hs-type">ControlNode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166336"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-105"></span><span> </span><span id="local-6989586621679166333"><span class="annot"><span class="annottext">getFetch :: ControlNode -> Build (Fetch a)
|
|
</span><a href="#local-6989586621679166333"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Fetch () -> Build (Fetch a)
|
|
forall (m :: * -> *) a. Monad m => a -> m a
|
|
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">(Fetch () -> Build (Fetch a)) -> Fetch () -> Build (Fetch a)
|
|
forall a b. (a -> b) -> a -> b
|
|
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">() -> Fetch ()
|
|
forall (f :: * -> *) a. Applicative f => a -> f a
|
|
</span><span class="hs-identifier hs-var">pure</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
|
|
</span><span id="line-106"></span><span>
|
|
</span><span id="line-107"></span><span id="local-6989586621679166332"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166332"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-108"></span><span> </span><span id="local-6989586621679166330"><span class="annot"><span class="annottext">getNodes :: ListOf f '[] -> Build (Set NodeName)
|
|
</span><a href="#local-6989586621679166330"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set NodeName -> Build (Set NodeName)
|
|
forall (m :: * -> *) a. Monad m => a -> m a
|
|
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">Set NodeName
|
|
forall a. Set a
|
|
</span><span class="hs-identifier hs-var">Set.empty</span></span></span><span>
|
|
</span><span id="line-109"></span><span>
|
|
</span><span id="line-110"></span><span id="local-6989586621679166327"><span id="local-6989586621679166328"><span id="local-6989586621679166329"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166329"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166328"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166329"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166327"><span class="hs-keyword hs-type">as</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166329"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166328"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-glyph">:</span><span> </span><span class="annot"><a href="#local-6989586621679166327"><span class="hs-keyword hs-type">as</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-111"></span><span> </span><span id="local-6989586621679166325"><span class="annot"><span class="annottext">getNodes :: ListOf f (a : as) -> Build (Set NodeName)
|
|
</span><a href="#local-6989586621679166325"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679166324"><span class="annot"><span class="annottext">x :: f a
|
|
</span><a href="#local-6989586621679166324"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="TensorFlow.Types.html#%3A%2F"><span class="hs-operator hs-type">:/</span></a></span><span> </span><span id="local-6989586621679166322"><span class="annot"><span class="annottext">xs :: ListOf f as
|
|
</span><a href="#local-6989586621679166322"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Set NodeName -> Set NodeName -> Set NodeName)
|
|
-> Build (Set NodeName)
|
|
-> Build (Set NodeName)
|
|
-> Build (Set NodeName)
|
|
forall (f :: * -> *) a b c.
|
|
Applicative f =>
|
|
(a -> b -> c) -> f a -> f b -> f c
|
|
</span><span class="hs-identifier hs-var">liftA2</span></span><span> </span><span class="annot"><span class="annottext">Set NodeName -> Set NodeName -> Set NodeName
|
|
forall a. Ord a => Set a -> Set a -> Set a
|
|
</span><span class="hs-identifier hs-var">Set.union</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f a -> Build (Set NodeName)
|
|
forall t. Nodes t => t -> Build (Set NodeName)
|
|
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">f a
|
|
</span><a href="#local-6989586621679166324"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ListOf f as -> Build (Set NodeName)
|
|
forall t. Nodes t => t -> Build (Set NodeName)
|
|
</span><a href="TensorFlow.Nodes.html#getNodes"><span class="hs-identifier hs-var">getNodes</span></a></span><span> </span><span class="annot"><span class="annottext">ListOf f as
|
|
</span><a href="#local-6989586621679166322"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span></span></span></span><span>
|
|
</span><span id="line-112"></span><span>
|
|
</span><span id="line-113"></span><span id="local-6989586621679166319"><span id="local-6989586621679166320"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="#local-6989586621679166320"><span class="hs-identifier hs-type">l</span></a></span><span> </span><span class="annot"><span class="hs-glyph hs-type">~</span></span><span> </span><span class="annot"><a href="TensorFlow.Types.html#List"><span class="hs-identifier hs-type">List</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166319"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679166320"><span class="hs-identifier hs-type">l</span></a></span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-114"></span><span> </span><span id="local-6989586621679166316"><span class="annot"><span class="annottext">getFetch :: ListOf f '[] -> Build (Fetch l)
|
|
</span><a href="#local-6989586621679166316"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Fetch (List '[]) -> Build (Fetch l)
|
|
forall (m :: * -> *) a. Monad m => a -> m a
|
|
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">(Fetch (List '[]) -> Build (Fetch l))
|
|
-> Fetch (List '[]) -> Build (Fetch l)
|
|
forall a b. (a -> b) -> a -> b
|
|
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">List '[] -> Fetch (List '[])
|
|
forall (f :: * -> *) a. Applicative f => a -> f a
|
|
</span><span class="hs-identifier hs-var">pure</span></span><span> </span><span class="annot"><span class="annottext">List '[]
|
|
forall (f :: * -> *). ListOf f '[]
|
|
</span><a href="TensorFlow.Types.html#Nil"><span class="hs-identifier hs-var">Nil</span></a></span></span></span><span>
|
|
</span><span id="line-115"></span><span>
|
|
</span><span id="line-116"></span><span id="local-6989586621679166309"><span id="local-6989586621679166310"><span id="local-6989586621679166311"><span id="local-6989586621679166312"><span id="local-6989586621679166313"><span id="local-6989586621679166314"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166314"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166313"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679166312"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166314"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166311"><span class="hs-identifier hs-type">ts</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#List"><span class="hs-identifier hs-type">List</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166310"><span class="hs-keyword hs-type">as</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166309"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><span class="hs-glyph hs-type">~</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Identity</span></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-117"></span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166314"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166313"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-glyph">:</span><span> </span><span class="annot"><a href="#local-6989586621679166311"><span class="hs-identifier hs-type">ts</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#ListOf"><span class="hs-identifier hs-type">ListOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166309"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166312"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-glyph">:</span><span> </span><span class="annot"><a href="#local-6989586621679166310"><span class="hs-keyword hs-type">as</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-118"></span><span> </span><span id="local-6989586621679166306"><span class="annot"><span class="annottext">getFetch :: ListOf f (t : ts) -> Build (Fetch (ListOf i (a : as)))
|
|
</span><a href="#local-6989586621679166306"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679166305"><span class="annot"><span class="annottext">x :: f a
|
|
</span><a href="#local-6989586621679166305"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="TensorFlow.Types.html#%3A%2F"><span class="hs-operator hs-type">:/</span></a></span><span> </span><span id="local-6989586621679166304"><span class="annot"><span class="annottext">xs :: ListOf f as
|
|
</span><a href="#local-6989586621679166304"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -> List as -> List (a : as))
|
|
-> Fetch a -> Fetch (List as) -> Fetch (List (a : as))
|
|
forall (f :: * -> *) a b c.
|
|
Applicative f =>
|
|
(a -> b -> c) -> f a -> f b -> f c
|
|
</span><span class="hs-identifier hs-var">liftA2</span></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679166303"><span class="annot"><span class="annottext">y :: a
|
|
</span><a href="#local-6989586621679166303"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621679166302"><span class="annot"><span class="annottext">ys :: List as
|
|
</span><a href="#local-6989586621679166302"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">-></span><span> </span><span class="annot"><span class="annottext">a
|
|
</span><a href="#local-6989586621679166303"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">a -> List as -> List (a : as)
|
|
forall a (as :: [*]). a -> List as -> List (a : as)
|
|
</span><a href="TensorFlow.Types.html#%2F%3A%2F"><span class="hs-operator hs-var">/:/</span></a></span><span> </span><span class="annot"><span class="annottext">List as
|
|
</span><a href="#local-6989586621679166302"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Fetch a -> Fetch (List as) -> Fetch (List (a : as)))
|
|
-> BuildT Identity (Fetch a)
|
|
-> BuildT Identity (Fetch (List as) -> Fetch (List (a : as)))
|
|
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
|
|
</span><span class="hs-operator hs-var"><$></span></span><span> </span><span class="annot"><span class="annottext">f a -> BuildT Identity (Fetch a)
|
|
forall t a. Fetchable t a => t -> Build (Fetch a)
|
|
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">f a
|
|
</span><a href="#local-6989586621679166305"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">BuildT Identity (Fetch (List as) -> Fetch (List (a : as)))
|
|
-> BuildT Identity (Fetch (List as))
|
|
-> BuildT Identity (Fetch (List (a : as)))
|
|
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
|
|
</span><span class="hs-operator hs-var"><*></span></span><span> </span><span class="annot"><span class="annottext">ListOf f as -> BuildT Identity (Fetch (List as))
|
|
forall t a. Fetchable t a => t -> Build (Fetch a)
|
|
</span><a href="TensorFlow.Nodes.html#getFetch"><span class="hs-identifier hs-var">getFetch</span></a></span><span> </span><span class="annot"><span class="annottext">ListOf f as
|
|
</span><a href="#local-6989586621679166304"><span class="hs-identifier hs-var">xs</span></a></span></span></span></span></span></span></span><span>
|
|
</span><span id="line-119"></span><span>
|
|
</span><span id="line-120"></span><span id="local-6989586621679166299"><span id="local-6989586621679166300"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Nodes"><span class="hs-identifier hs-type">Nodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Tensor.html#Tensor"><span class="hs-identifier hs-type">Tensor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166300"><span class="hs-identifier hs-type">v</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166299"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-121"></span><span> </span><span id="local-6989586621679166297"><span class="annot"><span class="annottext">getNodes :: Tensor v a -> Build (Set NodeName)
|
|
</span><a href="#local-6989586621679166297"><span class="hs-identifier hs-var hs-var hs-var hs-var">getNodes</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Tensor.html#Tensor"><span class="hs-identifier hs-type">Tensor</span></a></span><span> </span><span id="local-6989586621679166295"><span class="annot"><span class="annottext">o :: v Output
|
|
</span><a href="#local-6989586621679166295"><span class="hs-identifier hs-var">o</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NodeName -> Set NodeName
|
|
forall a. a -> Set a
|
|
</span><span class="hs-identifier hs-var">Set.singleton</span></span><span> </span><span class="annot"><span class="annottext">(NodeName -> Set NodeName)
|
|
-> (Output -> NodeName) -> Output -> Set NodeName
|
|
forall b c a. (b -> c) -> (a -> b) -> a -> c
|
|
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">Output -> NodeName
|
|
</span><a href="TensorFlow.Output.html#outputNodeName"><span class="hs-identifier hs-var hs-var">outputNodeName</span></a></span><span> </span><span class="annot"><span class="annottext">(Output -> Set NodeName)
|
|
-> BuildT Identity Output -> Build (Set NodeName)
|
|
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
|
|
</span><span class="hs-operator hs-var"><$></span></span><span> </span><span class="annot"><span class="annottext">v Output -> BuildT Identity Output
|
|
forall (v :: * -> *) a. TensorKind v => v a -> Build a
|
|
</span><a href="TensorFlow.Tensor.html#toBuild"><span class="hs-identifier hs-var">toBuild</span></a></span><span> </span><span class="annot"><span class="annottext">v Output
|
|
</span><a href="#local-6989586621679166295"><span class="hs-identifier hs-var">o</span></a></span></span></span><span>
|
|
</span><span id="line-122"></span><span>
|
|
</span><span id="line-123"></span><span class="annot"><a href="TensorFlow.Nodes.html#fetchTensorVector"><span class="hs-identifier hs-type">fetchTensorVector</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679166445"><span class="annot"><a href="#local-6989586621679166445"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span id="local-6989586621679166444"><span class="annot"><a href="#local-6989586621679166444"><span class="hs-identifier hs-type">v</span></a></span></span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#TensorType"><span class="hs-identifier hs-type">TensorType</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166445"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-124"></span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Tensor.html#Tensor"><span class="hs-identifier hs-type">Tensor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166444"><span class="hs-identifier hs-type">v</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166445"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-type">Fetch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#TensorData"><span class="hs-identifier hs-type">TensorData</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166445"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
|
</span><span id="line-125"></span><span id="fetchTensorVector"><span class="annot"><span class="annottext">fetchTensorVector :: Tensor v a -> Build (Fetch (TensorData a))
|
|
</span><a href="TensorFlow.Nodes.html#fetchTensorVector"><span class="hs-identifier hs-var hs-var">fetchTensorVector</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Tensor.html#Tensor"><span class="hs-identifier hs-type">Tensor</span></a></span><span> </span><span id="local-6989586621679166291"><span class="annot"><span class="annottext">o :: v Output
|
|
</span><a href="#local-6989586621679166291"><span class="hs-identifier hs-var">o</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
|
</span><span id="line-126"></span><span> </span><span id="local-6989586621679166290"><span class="annot"><span class="annottext">Text
|
|
</span><a href="#local-6989586621679166290"><span class="hs-identifier hs-var">outputName</span></a></span></span><span> </span><span class="hs-glyph"><-</span><span> </span><span class="annot"><span class="annottext">Output -> Text
|
|
</span><a href="TensorFlow.Build.html#encodeOutput"><span class="hs-identifier hs-var">encodeOutput</span></a></span><span> </span><span class="annot"><span class="annottext">(Output -> Text) -> BuildT Identity Output -> BuildT Identity Text
|
|
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
|
|
</span><span class="hs-operator hs-var"><$></span></span><span> </span><span class="annot"><span class="annottext">v Output -> BuildT Identity Output
|
|
forall (v :: * -> *) a. TensorKind v => v a -> Build a
|
|
</span><a href="TensorFlow.Tensor.html#toBuild"><span class="hs-identifier hs-var">toBuild</span></a></span><span> </span><span class="annot"><span class="annottext">v Output
|
|
</span><a href="#local-6989586621679166291"><span class="hs-identifier hs-var">o</span></a></span><span>
|
|
</span><span id="line-127"></span><span> </span><span class="annot"><span class="annottext">Fetch (TensorData a) -> Build (Fetch (TensorData a))
|
|
forall (f :: * -> *) a. Applicative f => a -> f a
|
|
</span><span class="hs-identifier hs-var">pure</span></span><span> </span><span class="annot"><span class="annottext">(Fetch (TensorData a) -> Build (Fetch (TensorData a)))
|
|
-> Fetch (TensorData a) -> Build (Fetch (TensorData a))
|
|
forall a b. (a -> b) -> a -> b
|
|
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">Set Text
|
|
-> (Map Text TensorData -> TensorData a) -> Fetch (TensorData a)
|
|
forall a. Set Text -> (Map Text TensorData -> a) -> Fetch a
|
|
</span><a href="TensorFlow.Nodes.html#Fetch"><span class="hs-identifier hs-var">Fetch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -> Set Text
|
|
forall a. a -> Set a
|
|
</span><span class="hs-identifier hs-var">Set.singleton</span></span><span> </span><span class="annot"><span class="annottext">Text
|
|
</span><a href="#local-6989586621679166290"><span class="hs-identifier hs-var">outputName</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((Map Text TensorData -> TensorData a) -> Fetch (TensorData a))
|
|
-> (Map Text TensorData -> TensorData a) -> Fetch (TensorData a)
|
|
forall a b. (a -> b) -> a -> b
|
|
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679166288"><span class="annot"><span class="annottext">tensors :: Map Text TensorData
|
|
</span><a href="#local-6989586621679166288"><span class="hs-identifier hs-var">tensors</span></a></span></span><span> </span><span class="hs-glyph">-></span><span>
|
|
</span><span id="line-128"></span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679166287"><span class="annot"><span class="annottext">tensorData :: TensorData
|
|
</span><a href="#local-6989586621679166287"><span class="hs-identifier hs-var hs-var">tensorData</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map Text TensorData
|
|
</span><a href="#local-6989586621679166288"><span class="hs-identifier hs-var">tensors</span></a></span><span> </span><span class="annot"><span class="annottext">Map Text TensorData -> Text -> TensorData
|
|
forall k a. Ord k => Map k a -> k -> a
|
|
</span><span class="hs-operator hs-var">Map.!</span></span><span> </span><span class="annot"><span class="annottext">Text
|
|
</span><a href="#local-6989586621679166290"><span class="hs-identifier hs-var">outputName</span></a></span><span>
|
|
</span><span id="line-129"></span><span> </span><span id="local-6989586621679166285"><span class="annot"><span class="annottext">expectedType :: DataType
|
|
</span><a href="#local-6989586621679166285"><span class="hs-identifier hs-var hs-var">expectedType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -> DataType
|
|
forall a. TensorType a => a -> DataType
|
|
</span><a href="TensorFlow.Types.html#tensorType"><span class="hs-identifier hs-var">tensorType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
|
|
forall a. HasCallStack => a
|
|
</span><span class="hs-identifier hs-var">undefined</span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679166445"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
|
|
</span><span id="line-130"></span><span> </span><span id="local-6989586621679166282"><span class="annot"><span class="annottext">actualType :: DataType
|
|
</span><a href="#local-6989586621679166282"><span class="hs-identifier hs-var hs-var">actualType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TensorData -> DataType
|
|
</span><a href="TensorFlow.Internal.FFI.html#tensorDataType"><span class="hs-identifier hs-var hs-var">FFI.tensorDataType</span></a></span><span> </span><span class="annot"><span class="annottext">TensorData
|
|
</span><a href="#local-6989586621679166287"><span class="hs-identifier hs-var">tensorData</span></a></span><span>
|
|
</span><span id="line-131"></span><span> </span><span id="local-6989586621679166280"><span class="annot"><span class="annottext">badTypeError :: TensorData a
|
|
</span><a href="#local-6989586621679166280"><span class="hs-identifier hs-var hs-var">badTypeError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -> TensorData a
|
|
forall a. HasCallStack => [Char] -> a
|
|
</span><span class="hs-identifier hs-var">error</span></span><span> </span><span class="annot"><span class="annottext">([Char] -> TensorData a) -> [Char] -> TensorData a
|
|
forall a b. (a -> b) -> a -> b
|
|
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="hs-string">"Bad tensor type: expected "</span></span><span>
|
|
</span><span id="line-132"></span><span> </span><span class="annot"><span class="annottext">[Char] -> [Char] -> [Char]
|
|
forall a. [a] -> [a] -> [a]
|
|
</span><span class="hs-operator hs-var">++</span></span><span> </span><span class="annot"><span class="annottext">DataType -> [Char]
|
|
forall a. Show a => a -> [Char]
|
|
</span><span class="hs-identifier hs-var">show</span></span><span> </span><span class="annot"><span class="annottext">DataType
|
|
</span><a href="#local-6989586621679166285"><span class="hs-identifier hs-var">expectedType</span></a></span><span>
|
|
</span><span id="line-133"></span><span> </span><span class="annot"><span class="annottext">[Char] -> [Char] -> [Char]
|
|
forall a. [a] -> [a] -> [a]
|
|
</span><span class="hs-operator hs-var">++</span></span><span> </span><span class="annot"><span class="hs-string">", got "</span></span><span>
|
|
</span><span id="line-134"></span><span> </span><span class="annot"><span class="annottext">[Char] -> [Char] -> [Char]
|
|
forall a. [a] -> [a] -> [a]
|
|
</span><span class="hs-operator hs-var">++</span></span><span> </span><span class="annot"><span class="annottext">DataType -> [Char]
|
|
forall a. Show a => a -> [Char]
|
|
</span><span class="hs-identifier hs-var">show</span></span><span> </span><span class="annot"><span class="annottext">DataType
|
|
</span><a href="#local-6989586621679166282"><span class="hs-identifier hs-var">actualType</span></a></span><span>
|
|
</span><span id="line-135"></span><span> </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">DataType
|
|
</span><a href="#local-6989586621679166285"><span class="hs-identifier hs-var">expectedType</span></a></span><span> </span><span class="annot"><span class="annottext">DataType -> DataType -> Bool
|
|
forall a. Eq a => a -> a -> Bool
|
|
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">DataType
|
|
</span><a href="#local-6989586621679166282"><span class="hs-identifier hs-var">actualType</span></a></span><span>
|
|
</span><span id="line-136"></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">TensorData a
|
|
</span><a href="#local-6989586621679166280"><span class="hs-identifier hs-var">badTypeError</span></a></span><span>
|
|
</span><span id="line-137"></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">TensorData -> TensorData a
|
|
forall a. TensorData -> TensorData a
|
|
</span><a href="TensorFlow.Types.html#TensorData"><span class="hs-identifier hs-var">TensorData</span></a></span><span> </span><span class="annot"><span class="annottext">TensorData
|
|
</span><a href="#local-6989586621679166287"><span class="hs-identifier hs-var">tensorData</span></a></span><span>
|
|
</span><span id="line-138"></span><span>
|
|
</span><span id="line-139"></span><span class="hs-comment">-- The constraint "a ~ a'" means that the input/output of fetch can constrain</span><span>
|
|
</span><span id="line-140"></span><span class="hs-comment">-- the TensorType of each other.</span><span>
|
|
</span><span id="line-141"></span><span id="local-6989586621679166273"><span id="local-6989586621679166274"><span id="local-6989586621679166275"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#TensorType"><span class="hs-identifier hs-type">TensorType</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166275"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166275"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><span class="hs-glyph hs-type">~</span></span><span> </span><span class="annot"><a href="#local-6989586621679166274"><span class="hs-identifier hs-type">a'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Tensor.html#Tensor"><span class="hs-identifier hs-type">Tensor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166273"><span class="hs-identifier hs-type">v</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166275"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#TensorData"><span class="hs-identifier hs-type">TensorData</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166274"><span class="hs-identifier hs-type">a'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-142"></span><span> </span><span id="local-6989586621679166270"><span class="annot"><span class="annottext">getFetch :: Tensor v a -> Build (Fetch (TensorData a'))
|
|
</span><a href="#local-6989586621679166270"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Tensor v a -> Build (Fetch (TensorData a'))
|
|
forall a (v :: * -> *).
|
|
TensorType a =>
|
|
Tensor v a -> Build (Fetch (TensorData a))
|
|
</span><a href="TensorFlow.Nodes.html#fetchTensorVector"><span class="hs-identifier hs-var">fetchTensorVector</span></a></span></span></span></span><span>
|
|
</span><span id="line-143"></span><span>
|
|
</span><span id="line-144"></span><span id="local-6989586621679166266"><span id="local-6989586621679166267"><span id="local-6989586621679166268"><span id="local-6989586621679166269"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Types.html#TensorType"><span class="hs-identifier hs-type">TensorType</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166269"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Types.html#TensorDataType"><span class="hs-identifier hs-type">TensorDataType</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166268"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166269"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679166269"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><span class="hs-glyph hs-type">~</span></span><span> </span><span class="annot"><a href="#local-6989586621679166267"><span class="hs-identifier hs-type">a'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=></span><span> </span><span class="annot"><a href="TensorFlow.Nodes.html#Fetchable"><span class="hs-identifier hs-type">Fetchable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Tensor.html#Tensor"><span class="hs-identifier hs-type">Tensor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166266"><span class="hs-identifier hs-type">v</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166269"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679166268"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679166267"><span class="hs-identifier hs-type">a'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
|
</span><span id="line-145"></span><span> </span><span id="local-6989586621679166263"><span class="annot"><span class="annottext">getFetch :: Tensor v a -> Build (Fetch (s a'))
|
|
</span><a href="#local-6989586621679166263"><span class="hs-identifier hs-var hs-var hs-var hs-var">getFetch</span></a></span></span><span> </span><span id="local-6989586621679166262"><span class="annot"><span class="annottext">t :: Tensor v a
|
|
</span><a href="#local-6989586621679166262"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TensorData a -> s a) -> Fetch (TensorData a) -> Fetch (s a)
|
|
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
|
|
</span><span class="hs-identifier hs-var">fmap</span></span><span> </span><span class="annot"><span class="annottext">TensorData a -> s a
|
|
forall (s :: * -> *) a. TensorDataType s a => TensorData a -> s a
|
|
</span><a href="TensorFlow.Types.html#decodeTensorData"><span class="hs-identifier hs-var">decodeTensorData</span></a></span><span> </span><span class="annot"><span class="annottext">(Fetch (TensorData a) -> Fetch (s a))
|
|
-> BuildT Identity (Fetch (TensorData a))
|
|
-> BuildT Identity (Fetch (s a))
|
|
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
|
|
</span><span class="hs-operator hs-var"><$></span></span><span> </span><span class="annot"><span class="annottext">Tensor v a -> BuildT Identity (Fetch (TensorData a))
|
|
forall a (v :: * -> *).
|
|
TensorType a =>
|
|
Tensor v a -> Build (Fetch (TensorData a))
|
|
</span><a href="TensorFlow.Nodes.html#fetchTensorVector"><span class="hs-identifier hs-var">fetchTensorVector</span></a></span><span> </span><span class="annot"><span class="annottext">Tensor v a
|
|
</span><a href="#local-6989586621679166262"><span class="hs-identifier hs-var">t</span></a></span></span></span></span></span><span>
|
|
</span><span id="line-146"></span></pre></body></html> |