mirror of
https://github.com/tensorflow/haskell.git
synced 2024-11-22 19:09:43 +01:00
parent
99f8c8cf56
commit
61e58fd33f
22 changed files with 106 additions and 51 deletions
|
@ -16,11 +16,10 @@ packages:
|
|||
extra-deps:
|
||||
- snappy-framing-0.1.1
|
||||
- snappy-0.2.0.2
|
||||
# `haskell-src-exts < 1.20` is needed due the dependency on
|
||||
# `proto-lens-protoc < 0.3` in the `tensorflow-proto` package:
|
||||
- haskell-src-exts-1.19.1
|
||||
- proto-lens-protobuf-types-0.2.2.0
|
||||
- proto-lens-protoc-0.2.2.3
|
||||
- proto-lens-protobuf-types-0.3.0.1
|
||||
- proto-lens-protoc-0.3.1.0
|
||||
- proto-lens-0.3.1.0
|
||||
- lens-labels-0.2.0.1
|
||||
|
||||
# For Mac OS X, whose linker doesn't use this path by default
|
||||
# unless you run `xcode-select --install`.
|
||||
|
|
|
@ -15,7 +15,7 @@ cabal-version: >=1.24
|
|||
library
|
||||
exposed-modules: TensorFlow.GenOps.Core
|
||||
build-depends: bytestring
|
||||
, proto-lens == 0.2.*
|
||||
, proto-lens == 0.3.*
|
||||
, tensorflow == 0.2.*
|
||||
, base >= 4.7 && < 5
|
||||
, lens-family
|
||||
|
@ -26,7 +26,7 @@ custom-setup
|
|||
setup-depends: Cabal
|
||||
, bytestring
|
||||
, directory
|
||||
, proto-lens == 0.2.*
|
||||
, proto-lens == 0.3.*
|
||||
, tensorflow-opgen == 0.2.*
|
||||
, tensorflow == 0.2.*
|
||||
, base >= 4.7 && < 5
|
||||
|
|
|
@ -69,7 +69,8 @@ import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds)
|
|||
import Lens.Family2 ((.~), (&))
|
||||
import Network.HostName (getHostName)
|
||||
import Proto.Tensorflow.Core.Framework.Summary (Summary)
|
||||
import Proto.Tensorflow.Core.Util.Event (Event, fileVersion, graphDef, step, summary, wallTime)
|
||||
import Proto.Tensorflow.Core.Util.Event (Event)
|
||||
import Proto.Tensorflow.Core.Util.Event_Fields (fileVersion, graphDef, step, summary, wallTime)
|
||||
import System.Directory (createDirectoryIfMissing)
|
||||
import System.FilePath ((</>))
|
||||
import TensorFlow.Build (MonadBuild, Build, asGraphDef)
|
||||
|
|
|
@ -24,7 +24,7 @@ library
|
|||
, filepath
|
||||
, hostname
|
||||
, lens-family
|
||||
, proto-lens == 0.2.*
|
||||
, proto-lens == 0.3.*
|
||||
, resourcet
|
||||
, stm
|
||||
, stm-chans
|
||||
|
|
|
@ -21,7 +21,8 @@ import Data.Default (def)
|
|||
import Data.List ((\\))
|
||||
import Data.ProtoLens (encodeMessage, decodeMessageOrDie)
|
||||
import Lens.Family2 ((^.), (.~), (&))
|
||||
import Proto.Tensorflow.Core.Util.Event (Event, graphDef, fileVersion, step)
|
||||
import Proto.Tensorflow.Core.Util.Event (Event)
|
||||
import Proto.Tensorflow.Core.Util.Event_Fields (graphDef, fileVersion, step)
|
||||
import System.Directory (getDirectoryContents)
|
||||
import System.FilePath ((</>))
|
||||
import System.IO.Temp (withSystemTempDirectory)
|
||||
|
|
|
@ -20,7 +20,7 @@ library
|
|||
exposed-modules: TensorFlow.Examples.MNIST.Parse
|
||||
, TensorFlow.Examples.MNIST.TrainedGraph
|
||||
other-modules: Paths_tensorflow_mnist
|
||||
build-depends: proto-lens == 0.2.*
|
||||
build-depends: proto-lens == 0.3.*
|
||||
, base >= 4.7 && < 5
|
||||
, binary
|
||||
, bytestring
|
||||
|
|
|
@ -24,12 +24,13 @@ import qualified Data.Text.IO as Text
|
|||
import Lens.Family2 ((&), (.~), (^.))
|
||||
import Prelude hiding (abs)
|
||||
import Proto.Tensorflow.Core.Framework.Graph
|
||||
( GraphDef(..)
|
||||
, version
|
||||
( GraphDef(..) )
|
||||
import Proto.Tensorflow.Core.Framework.Graph_Fields
|
||||
( version
|
||||
, node )
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef
|
||||
( NodeDef(..)
|
||||
, op )
|
||||
( NodeDef(..) )
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef_Fields (op)
|
||||
import System.IO as IO
|
||||
import TensorFlow.Examples.MNIST.InputData
|
||||
import TensorFlow.Examples.MNIST.Parse
|
||||
|
|
|
@ -60,7 +60,9 @@ import Options.Applicative (Parser, help, long, strOption, value)
|
|||
import Proto.Tensorflow.Core.Framework.OpDef
|
||||
( OpList
|
||||
, OpDef
|
||||
, attr
|
||||
)
|
||||
import Proto.Tensorflow.Core.Framework.OpDef_Fields
|
||||
( attr
|
||||
, inputArg
|
||||
, name
|
||||
, op
|
||||
|
|
|
@ -31,12 +31,14 @@ import qualified Data.Set as Set
|
|||
import Data.Text (Text)
|
||||
import qualified Data.Text as Text
|
||||
import Lens.Family2 ((^.))
|
||||
import Proto.Tensorflow.Core.Framework.AttrValue (list)
|
||||
import Proto.Tensorflow.Core.Framework.AttrValue_Fields (list)
|
||||
import Proto.Tensorflow.Core.Framework.OpDef
|
||||
( OpDef
|
||||
, OpDef'ArgDef
|
||||
, OpDef'AttrDef
|
||||
, allowedValues
|
||||
)
|
||||
import Proto.Tensorflow.Core.Framework.OpDef_Fields
|
||||
( allowedValues
|
||||
, attr
|
||||
, maybe'defaultValue
|
||||
, description
|
||||
|
@ -51,6 +53,7 @@ import Proto.Tensorflow.Core.Framework.OpDef
|
|||
, typeAttr
|
||||
, type'
|
||||
)
|
||||
|
||||
import Proto.Tensorflow.Core.Framework.Types (DataType(DT_RESOURCE))
|
||||
|
||||
data ParsedOp = ParsedOp
|
||||
|
|
|
@ -16,7 +16,7 @@ library
|
|||
hs-source-dirs: src
|
||||
exposed-modules: TensorFlow.OpGen.ParsedOp
|
||||
, TensorFlow.OpGen
|
||||
build-depends: proto-lens == 0.2.*
|
||||
build-depends: proto-lens == 0.3.*
|
||||
, tensorflow-proto == 0.2.*
|
||||
, base >= 4.7 && < 5
|
||||
, bytestring
|
||||
|
|
|
@ -103,8 +103,9 @@ import TensorFlow.Tensor
|
|||
, ToTensor(..)
|
||||
)
|
||||
import TensorFlow.Types (Attribute, OneOf, TensorType, attrLens)
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef
|
||||
(NodeDef, attr, input, op, name)
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef (NodeDef)
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef_Fields
|
||||
( attr, input, op, name)
|
||||
|
||||
type GradientCompatible a =
|
||||
-- TODO(fmayle): MaxPoolGrad doesn't support Double for some reason.
|
||||
|
|
|
@ -160,13 +160,14 @@ import Data.ProtoLens (def)
|
|||
import Data.Text.Encoding (encodeUtf8)
|
||||
import Lens.Family2 ((.~), (&))
|
||||
import Text.Printf (printf)
|
||||
import Proto.Tensorflow.Core.Framework.Tensor
|
||||
( TensorProto
|
||||
, dtype
|
||||
import Proto.Tensorflow.Core.Framework.Tensor (TensorProto)
|
||||
import Proto.Tensorflow.Core.Framework.Tensor_Fields
|
||||
( dtype
|
||||
, tensorShape
|
||||
)
|
||||
import qualified Proto.Tensorflow.Core.Framework.TensorShape
|
||||
import qualified Proto.Tensorflow.Core.Framework.TensorShape_Fields
|
||||
as TensorShape
|
||||
|
||||
import TensorFlow.Build
|
||||
import TensorFlow.BuildOp
|
||||
import TensorFlow.ControlFlow (group)
|
||||
|
|
|
@ -21,7 +21,7 @@ library
|
|||
, TensorFlow.NN
|
||||
, TensorFlow.Queue
|
||||
, TensorFlow.Variable
|
||||
build-depends: proto-lens == 0.2.*
|
||||
build-depends: proto-lens == 0.3.*
|
||||
, base >= 4.7 && < 5
|
||||
, bytestring
|
||||
, fgl
|
||||
|
|
|
@ -21,11 +21,12 @@ module Main where
|
|||
import Control.Monad.IO.Class (liftIO)
|
||||
import Lens.Family2 ((^.), (.~))
|
||||
import Data.List (sort)
|
||||
import Proto.Tensorflow.Core.Framework.Graph
|
||||
import Proto.Tensorflow.Core.Framework.Graph_Fields
|
||||
( node )
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef
|
||||
( NodeDef
|
||||
, device
|
||||
( NodeDef )
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef_Fields
|
||||
( device
|
||||
, name
|
||||
, op )
|
||||
import TensorFlow.Build
|
||||
|
|
|
@ -39,8 +39,8 @@ import qualified TensorFlow.Output as TF
|
|||
import qualified TensorFlow.Types as TF
|
||||
import qualified TensorFlow.Variable as TF
|
||||
|
||||
import Proto.Tensorflow.Core.Framework.Graph (node)
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef (op)
|
||||
import Proto.Tensorflow.Core.Framework.Graph_Fields (node)
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef_Fields (op)
|
||||
|
||||
import qualified Data.ByteString.Char8 as BS
|
||||
|
||||
|
|
|
@ -19,55 +19,94 @@ extra-source-files: third_party/tensorflow/tensorflow/core/example/*.proto
|
|||
|
||||
library
|
||||
exposed-modules: Proto.Tensorflow.Core.Example.Example
|
||||
, Proto.Tensorflow.Core.Example.Example_Fields
|
||||
, Proto.Tensorflow.Core.Example.ExampleParserConfiguration
|
||||
, Proto.Tensorflow.Core.Example.ExampleParserConfiguration_Fields
|
||||
, Proto.Tensorflow.Core.Example.Feature
|
||||
, Proto.Tensorflow.Core.Example.Feature_Fields
|
||||
, Proto.Tensorflow.Core.Framework.AllocationDescription
|
||||
, Proto.Tensorflow.Core.Framework.AllocationDescription_Fields
|
||||
, Proto.Tensorflow.Core.Framework.AttrValue
|
||||
, Proto.Tensorflow.Core.Framework.AttrValue_Fields
|
||||
, Proto.Tensorflow.Core.Framework.CostGraph
|
||||
, Proto.Tensorflow.Core.Framework.CostGraph_Fields
|
||||
, Proto.Tensorflow.Core.Framework.DeviceAttributes
|
||||
, Proto.Tensorflow.Core.Framework.DeviceAttributes_Fields
|
||||
, Proto.Tensorflow.Core.Framework.Function
|
||||
, Proto.Tensorflow.Core.Framework.Function_Fields
|
||||
, Proto.Tensorflow.Core.Framework.Graph
|
||||
, Proto.Tensorflow.Core.Framework.Graph_Fields
|
||||
, Proto.Tensorflow.Core.Framework.KernelDef
|
||||
, Proto.Tensorflow.Core.Framework.KernelDef_Fields
|
||||
, Proto.Tensorflow.Core.Framework.LogMemory
|
||||
, Proto.Tensorflow.Core.Framework.LogMemory_Fields
|
||||
, Proto.Tensorflow.Core.Framework.NodeDef
|
||||
, Proto.Tensorflow.Core.Framework.NodeDef_Fields
|
||||
, Proto.Tensorflow.Core.Framework.OpDef
|
||||
, Proto.Tensorflow.Core.Framework.OpDef_Fields
|
||||
, Proto.Tensorflow.Core.Framework.ResourceHandle
|
||||
, Proto.Tensorflow.Core.Framework.ResourceHandle_Fields
|
||||
, Proto.Tensorflow.Core.Framework.StepStats
|
||||
, Proto.Tensorflow.Core.Framework.StepStats_Fields
|
||||
, Proto.Tensorflow.Core.Framework.Summary
|
||||
, Proto.Tensorflow.Core.Framework.Summary_Fields
|
||||
, Proto.Tensorflow.Core.Framework.Tensor
|
||||
, Proto.Tensorflow.Core.Framework.Tensor_Fields
|
||||
, Proto.Tensorflow.Core.Framework.TensorDescription
|
||||
, Proto.Tensorflow.Core.Framework.TensorDescription_Fields
|
||||
, Proto.Tensorflow.Core.Framework.TensorShape
|
||||
, Proto.Tensorflow.Core.Framework.TensorShape_Fields
|
||||
, Proto.Tensorflow.Core.Framework.TensorSlice
|
||||
, Proto.Tensorflow.Core.Framework.TensorSlice_Fields
|
||||
, Proto.Tensorflow.Core.Framework.Types
|
||||
, Proto.Tensorflow.Core.Framework.Types_Fields
|
||||
, Proto.Tensorflow.Core.Framework.Variable
|
||||
, Proto.Tensorflow.Core.Framework.Variable_Fields
|
||||
, Proto.Tensorflow.Core.Framework.Versions
|
||||
, Proto.Tensorflow.Core.Framework.Versions_Fields
|
||||
, Proto.Tensorflow.Core.Lib.Core.ErrorCodes
|
||||
, Proto.Tensorflow.Core.Protobuf.Cluster
|
||||
, Proto.Tensorflow.Core.Protobuf.Cluster_Fields
|
||||
, Proto.Tensorflow.Core.Protobuf.Config
|
||||
, Proto.Tensorflow.Core.Protobuf.Config_Fields
|
||||
, Proto.Tensorflow.Core.Protobuf.ControlFlow
|
||||
, Proto.Tensorflow.Core.Protobuf.ControlFlow_Fields
|
||||
, Proto.Tensorflow.Core.Protobuf.Debug
|
||||
, Proto.Tensorflow.Core.Protobuf.Debug_Fields
|
||||
, Proto.Tensorflow.Core.Protobuf.MetaGraph
|
||||
, Proto.Tensorflow.Core.Protobuf.MetaGraph_Fields
|
||||
, Proto.Tensorflow.Core.Protobuf.NamedTensor
|
||||
, Proto.Tensorflow.Core.Protobuf.NamedTensor_Fields
|
||||
, Proto.Tensorflow.Core.Protobuf.QueueRunner
|
||||
, Proto.Tensorflow.Core.Protobuf.QueueRunner_Fields
|
||||
, Proto.Tensorflow.Core.Protobuf.RewriterConfig
|
||||
, Proto.Tensorflow.Core.Protobuf.RewriterConfig_Fields
|
||||
, Proto.Tensorflow.Core.Protobuf.SavedModel
|
||||
, Proto.Tensorflow.Core.Protobuf.SavedModel_Fields
|
||||
, Proto.Tensorflow.Core.Protobuf.Saver
|
||||
, Proto.Tensorflow.Core.Protobuf.Saver_Fields
|
||||
, Proto.Tensorflow.Core.Protobuf.TensorBundle
|
||||
, Proto.Tensorflow.Core.Protobuf.TensorBundle_Fields
|
||||
, Proto.Tensorflow.Core.Protobuf.TensorflowServer
|
||||
, Proto.Tensorflow.Core.Protobuf.TensorflowServer_Fields
|
||||
, Proto.Tensorflow.Core.Util.Event
|
||||
, Proto.Tensorflow.Core.Util.Event_Fields
|
||||
, Proto.Tensorflow.Core.Util.MemmappedFileSystem
|
||||
, Proto.Tensorflow.Core.Util.MemmappedFileSystem_Fields
|
||||
, Proto.Tensorflow.Core.Util.SavedTensorSlice
|
||||
, Proto.Tensorflow.Core.Util.SavedTensorSlice_Fields
|
||||
, Proto.Tensorflow.Core.Util.TestLog
|
||||
build-depends: proto-lens >= 0.2.2 && < 0.3
|
||||
, proto-lens-protoc >= 0.2.2.1 && < 0.3
|
||||
, proto-lens-protobuf-types == 0.2.*
|
||||
, Proto.Tensorflow.Core.Util.TestLog_Fields
|
||||
build-depends: proto-lens == 0.3.*
|
||||
, proto-lens-protoc == 0.3.*
|
||||
, proto-lens-protobuf-types == 0.3.*
|
||||
, base >= 4.7 && < 5
|
||||
default-language: Haskell2010
|
||||
include-dirs: .
|
||||
|
||||
custom-setup
|
||||
setup-depends: Cabal
|
||||
, proto-lens-protoc == 0.2.*
|
||||
, proto-lens-protoc == 0.3.*
|
||||
, base >= 4.7 && < 5
|
||||
source-repository head
|
||||
type: git
|
||||
|
|
|
@ -78,13 +78,11 @@ import qualified Data.Text as Text
|
|||
import Lens.Family2 (Lens', (.~), (^.), (&))
|
||||
import Lens.Family2.State.Strict (MonadState, use, uses, (.=), (<>=), (%=))
|
||||
import Lens.Family2.Unchecked (lens)
|
||||
import Proto.Tensorflow.Core.Framework.Graph
|
||||
( GraphDef
|
||||
, node
|
||||
)
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef
|
||||
( NodeDef
|
||||
, attr
|
||||
import Proto.Tensorflow.Core.Framework.Graph (GraphDef)
|
||||
import Proto.Tensorflow.Core.Framework.Graph_Fields (node)
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef (NodeDef)
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef_Fields
|
||||
( attr
|
||||
, input
|
||||
, device
|
||||
, name
|
||||
|
|
|
@ -50,7 +50,8 @@ import Data.Set (Set)
|
|||
import Data.Text.Encoding (encodeUtf8)
|
||||
import Lens.Family2 (Lens', (^.), (&), (.~))
|
||||
import Lens.Family2.Unchecked (lens)
|
||||
import Proto.Tensorflow.Core.Framework.Graph (GraphDef, node)
|
||||
import Proto.Tensorflow.Core.Framework.Graph (GraphDef)
|
||||
import Proto.Tensorflow.Core.Framework.Graph_Fields (node)
|
||||
import Proto.Tensorflow.Core.Protobuf.Config (ConfigProto)
|
||||
import TensorFlow.Build
|
||||
import TensorFlow.Nodes
|
||||
|
|
|
@ -34,7 +34,7 @@ import qualified Data.Text as Text
|
|||
import Lens.Family2 ((^.))
|
||||
import Lens.Family2.State ((%=), use)
|
||||
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef (device)
|
||||
import Proto.Tensorflow.Core.Framework.NodeDef_Fields (device)
|
||||
import TensorFlow.Build
|
||||
import TensorFlow.Output (Output, NodeName, outputNodeName, Device(..))
|
||||
import TensorFlow.Types
|
||||
|
|
|
@ -90,7 +90,9 @@ import qualified Data.Vector.Storable as S
|
|||
import Proto.Tensorflow.Core.Framework.AttrValue
|
||||
( AttrValue(..)
|
||||
, AttrValue'ListValue(..)
|
||||
, b
|
||||
)
|
||||
import Proto.Tensorflow.Core.Framework.AttrValue_Fields
|
||||
( b
|
||||
, f
|
||||
, i
|
||||
, s
|
||||
|
@ -99,11 +101,13 @@ import Proto.Tensorflow.Core.Framework.AttrValue
|
|||
, shape
|
||||
, tensor
|
||||
)
|
||||
|
||||
import Proto.Tensorflow.Core.Framework.ResourceHandle
|
||||
(ResourceHandleProto)
|
||||
import Proto.Tensorflow.Core.Framework.Tensor as Tensor
|
||||
( TensorProto(..)
|
||||
, boolVal
|
||||
(TensorProto(..))
|
||||
import Proto.Tensorflow.Core.Framework.Tensor_Fields as Tensor
|
||||
( boolVal
|
||||
, doubleVal
|
||||
, floatVal
|
||||
, intVal
|
||||
|
@ -113,9 +117,11 @@ import Proto.Tensorflow.Core.Framework.Tensor as Tensor
|
|||
, uint32Val
|
||||
, uint64Val
|
||||
)
|
||||
|
||||
import Proto.Tensorflow.Core.Framework.TensorShape
|
||||
( TensorShapeProto(..)
|
||||
, dim
|
||||
(TensorShapeProto(..))
|
||||
import Proto.Tensorflow.Core.Framework.TensorShape_Fields
|
||||
( dim
|
||||
, size
|
||||
, unknownRank
|
||||
)
|
||||
|
|
|
@ -36,7 +36,7 @@ library
|
|||
, TensorFlow.Types
|
||||
other-modules: TensorFlow.Internal.Raw
|
||||
build-tools: c2hs
|
||||
build-depends: proto-lens == 0.2.*
|
||||
build-depends: proto-lens == 0.3.*
|
||||
, tensorflow-proto == 0.2.*
|
||||
, base >= 4.7 && < 5
|
||||
, async
|
||||
|
|
|
@ -22,7 +22,8 @@ import TensorFlow.Internal.FFI (getAllOpList)
|
|||
import Test.HUnit (assertBool, assertFailure)
|
||||
import Test.Framework (defaultMain)
|
||||
import Test.Framework.Providers.HUnit (testCase)
|
||||
import Proto.Tensorflow.Core.Framework.OpDef (OpList, op)
|
||||
import Proto.Tensorflow.Core.Framework.OpDef (OpList)
|
||||
import Proto.Tensorflow.Core.Framework.OpDef_Fields (op)
|
||||
|
||||
testParseAll :: IO ()
|
||||
testParseAll = do
|
||||
|
|
Loading…
Reference in a new issue