Skip to content

Upgraded to tensorflow 2.3 #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
1 change: 1 addition & 0 deletions tensorflow-core-ops/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ blackList =
, "ParallelInterleaveDatasetV2"
, "ParallelMapDataset"
, "ParseSequenceExample"
, "ParseSequenceExampleV2"
, "PartitionedCall"
, "ReduceDataset"
, "RemoteCall"
Expand Down
4 changes: 2 additions & 2 deletions tensorflow-core-ops/tensorflow-core-ops.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ library
exposed-modules: TensorFlow.GenOps.Core
autogen-modules: TensorFlow.GenOps.Core
build-depends: bytestring
, proto-lens == 0.6.*
, proto-lens == 0.7.*
, tensorflow == 0.2.*
, base >= 4.7 && < 5
, lens-family == 2.*
Expand All @@ -27,7 +27,7 @@ custom-setup
setup-depends: Cabal
, bytestring
, directory
, proto-lens == 0.6.*
, proto-lens == 0.7.*
, tensorflow-opgen == 0.2.*
, tensorflow == 0.2.*
, base >= 4.7 && < 5
Expand Down
1 change: 1 addition & 0 deletions tensorflow-core-ops/third_party
2 changes: 1 addition & 1 deletion tensorflow-logging/tensorflow-logging.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ library
, filepath
, hostname
, lens-family == 2.*
, proto-lens == 0.6.*
, proto-lens == 0.7.*
, resourcet
, stm
, stm-chans
Expand Down
2 changes: 1 addition & 1 deletion tensorflow-mnist/tensorflow-mnist.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.*
build-depends: proto-lens == 0.7.*
, base >= 4.7 && < 5
, binary
, bytestring
Expand Down
2 changes: 2 additions & 0 deletions tensorflow-opgen/src/TensorFlow/OpGen/ParsedOp.hs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ data Attr a = Attr
-- | The type of an attribute.
data AttrType = AttrSingle AttrBaseType
| AttrList AttrBaseType
| AttrFunc
deriving Eq

data AttrBaseType = AttrBytes | AttrInt64 | AttrFloat | AttrBool
Expand Down Expand Up @@ -341,5 +342,6 @@ parseAttrType o = \case
"list(type)" -> AttrList AttrType
"list(shape)" -> AttrList AttrShape
"list(tensor)" -> AttrList AttrTensor
"func" -> AttrFunc
t -> error $ "parseAttrType: unrecognized type " ++ show t
++ " for op " ++ show (o ^. name)
2 changes: 1 addition & 1 deletion tensorflow-opgen/tensorflow-opgen.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ library
hs-source-dirs: src
exposed-modules: TensorFlow.OpGen.ParsedOp
, TensorFlow.OpGen
build-depends: proto-lens == 0.6.*
build-depends: proto-lens == 0.7.*
, tensorflow-proto == 0.2.*
, base >= 4.7 && < 5
, bytestring
Expand Down
2 changes: 1 addition & 1 deletion tensorflow-ops/tensorflow-ops.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ library
, TensorFlow.NN
, TensorFlow.Queue
, TensorFlow.Variable
build-depends: proto-lens == 0.6.*
build-depends: proto-lens == 0.7.*
, base >= 4.7 && < 5
, bytestring
, fgl
Expand Down
6 changes: 3 additions & 3 deletions tensorflow-proto/tensorflow-proto.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ library
, Proto.Tensorflow.Core.Util.SavedTensorSlice_Fields
, Proto.Tensorflow.Core.Util.TestLog
, Proto.Tensorflow.Core.Util.TestLog_Fields
build-depends: proto-lens == 0.6.*
, proto-lens-runtime == 0.6.*
, proto-lens-protobuf-types == 0.6.*
build-depends: proto-lens == 0.7.*
, proto-lens-runtime == 0.7.*
, proto-lens-protobuf-types == 0.7.*
, base >= 4.7 && < 5
default-language: Haskell2010
include-dirs: .
Expand Down
1 change: 1 addition & 0 deletions tensorflow/src/TensorFlow/Build.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module TensorFlow.Build
import Data.ProtoLens.Message(defMessage)
import Control.Monad.Catch (MonadThrow, MonadCatch, MonadMask)
import Control.Monad.Fix (MonadFix(..))
import Control.Monad.Fail (MonadFail(..))
import Control.Monad.IO.Class (MonadIO(..))
import Control.Monad.Trans.Class (MonadTrans(..))
import Control.Monad.Trans.State.Strict(StateT(..), mapStateT, evalStateT)
Expand Down
100 changes: 100 additions & 0 deletions tensorflow/src/TensorFlow/BuildOp.hs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,106 @@ instance ( PureResult a1
<*> pureResult
<*> pureResult

instance ( PureResult a1
, PureResult a2
, PureResult a3
, PureResult a4
, PureResult a5
, PureResult a6
, PureResult a7
, PureResult a8
, PureResult a9
)
=> PureResult (a1, a2, a3, a4, a5, a6, a7, a8, a9) where
pureResult = (,,,,,,,,)
<$> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult

instance ( PureResult a1
, PureResult a2
, PureResult a3
, PureResult a4
, PureResult a5
, PureResult a6
, PureResult a7
, PureResult a8
, PureResult a9
, PureResult a10
)
=> PureResult (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) where
pureResult = (,,,,,,,,,)
<$> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult

instance ( PureResult a1
, PureResult a2
, PureResult a3
, PureResult a4
, PureResult a5
, PureResult a6
, PureResult a7
, PureResult a8
, PureResult a9
, PureResult a10
, PureResult a11
)
=> PureResult (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) where
pureResult = (,,,,,,,,,,)
<$> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult

instance ( PureResult a1
, PureResult a2
, PureResult a3
, PureResult a4
, PureResult a5
, PureResult a6
, PureResult a7
, PureResult a8
, PureResult a9
, PureResult a10
, PureResult a11
, PureResult a12
)
=> PureResult (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) where
pureResult = (,,,,,,,,,,,)
<$> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult

instance PureResult a => PureResult [a] where
pureResult = do
ResultState i ns <- get
Expand Down
1 change: 1 addition & 0 deletions tensorflow/src/TensorFlow/Session.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module TensorFlow.Session (
import Data.ProtoLens.Message(defMessage)
import Control.Monad (forever, unless, void)
import Control.Monad.Catch (MonadThrow, MonadCatch, MonadMask)
import Control.Monad.Fail (MonadFail(..))
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Trans.Class (MonadTrans, lift)
import Control.Monad.Trans.Reader (ReaderT(..), ask, asks)
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/tensorflow.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ library
, TensorFlow.Types
other-modules: TensorFlow.Internal.Raw
build-tools: c2hs
build-depends: proto-lens == 0.6.*
build-depends: proto-lens == 0.7.*
, tensorflow-proto == 0.2.*
, base >= 4.7 && < 5
, async
Expand Down