Skip to content

Commit c66c912

Browse files
authored
Tensorflow 2.3.0 Support (#267)
* Tensorflow 2.3.0 building and passing tests. * Added einsum and test. * Added ByteString as a possible argument to a function. * Support more data types for Adam. * Move to later version of LTS on stackage. * Added a wrapper module for convolution functions. * Update ci build to use a later version of stack. * Removed a deprecated import in GradientTest.
1 parent 568c9b6 commit c66c912

File tree

21 files changed

+409
-75
lines changed

21 files changed

+409
-75
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.stack/
33
tensorflow-mnist-input-data/data/*.gz
44
.DS_Store
5+
stack.yaml.lock

ci_build/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# stack to be installed on the host. This comes at the expense of
44
# flexibility.
55

6-
FROM tensorflow/tensorflow:1.14.0
6+
FROM tensorflow/tensorflow:2.3.0
77
LABEL maintainer="TensorFlow authors <tensorflow-haskell@googlegroups.com>"
88

99
# The build context directory is the top of the tensorflow-haskell
@@ -30,14 +30,14 @@ RUN \
3030
netbase \
3131
&& \
3232
# Installs stack.
33-
curl -O -L https://github.com/commercialhaskell/stack/releases/download/v2.1.3/stack-2.1.3-linux-x86_64.tar.gz && \
34-
tar zxf stack-2.1.3-linux-x86_64.tar.gz -C /usr/local/bin stack-2.1.3-linux-x86_64/stack --strip 1 && \
33+
curl -O -L https://github.com/commercialhaskell/stack/releases/download/v2.5.1/stack-2.5.1-linux-x86_64.tar.gz && \
34+
tar zxf stack-2.5.1-linux-x86_64.tar.gz -C /usr/local/bin stack-2.5.1-linux-x86_64/stack --strip 1 && \
3535
# Installs protoc and the libraries.
36-
curl -O -L https://github.com/google/protobuf/releases/download/v3.9.1/protoc-3.9.1-linux-x86_64.zip && \
37-
unzip -d /usr/local protoc-3.9.1-linux-x86_64.zip bin/protoc && \
36+
curl -O -L https://github.com/google/protobuf/releases/download/v3.13.0/protoc-3.13.0-linux-x86_64.zip && \
37+
unzip -d /usr/local protoc-3.13.0-linux-x86_64.zip bin/protoc && \
3838
chmod 755 /usr/local/bin/protoc && \
39-
curl -O https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz && \
40-
tar zxf libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz -C /usr/local && \
39+
curl -O https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.3.0.tar.gz && \
40+
tar zxf libtensorflow-cpu-linux-x86_64-2.3.0.tar.gz -C /usr/local && \
4141
ldconfig && \
4242
stack setup && \
4343
stack test --only-dependencies

docker/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prepare the image with:
22
# docker build -t tensorflow/haskell:v0 docker
3-
FROM tensorflow/tensorflow:1.14.0
3+
FROM tensorflow/tensorflow:2.3.0
44
LABEL maintainer="TensorFlow authors <tensorflow-haskell@googlegroups.com>"
55

66
RUN apt-get update
@@ -28,11 +28,11 @@ RUN dpkg-reconfigure locales && \
2828

2929
# Installs protoc and the libraries.
3030
RUN \
31-
curl -O -L https://github.com/google/protobuf/releases/download/v3.9.1/protoc-3.9.1-linux-x86_64.zip && \
32-
unzip -d /usr/local protoc-3.9.1-linux-x86_64.zip bin/protoc && \
31+
curl -O -L https://github.com/google/protobuf/releases/download/v3.13.0/protoc-3.13.0-linux-x86_64.zip && \
32+
unzip -d /usr/local protoc-3.13.0-linux-x86_64.zip bin/protoc && \
3333
chmod 755 /usr/local/bin/protoc && \
34-
curl -O https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz && \
35-
tar zxf libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz -C /usr/local && \
34+
curl -O https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.3.0.tar.gz && \
35+
tar zxf libtensorflow-cpu-linux-x86_64-2.3.0.tar.gz -C /usr/local && \
3636
ldconfig
3737

3838
ENV LANG en_US.UTF-8

docker/gpu/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prepare the image with:
22
# docker build -t tensorflow/haskell:1.14.0-gpu docker/gpu
3-
FROM tensorflow/tensorflow:1.14.0-gpu
3+
FROM tensorflow/tensorflow:2.3.0-gpu
44
LABEL maintainer="TensorFlow authors <tensorflow-haskell@googlegroups.com>"
55

66
RUN apt-get update
@@ -28,11 +28,11 @@ RUN dpkg-reconfigure locales && \
2828

2929
# Installs protoc and the libraries.
3030
RUN \
31-
curl -O -L https://github.com/google/protobuf/releases/download/v3.9.1/protoc-3.9.1-linux-x86_64.zip && \
32-
unzip -d /usr/local protoc-3.9.1-linux-x86_64.zip bin/protoc && \
31+
curl -O -L https://github.com/google/protobuf/releases/download/v3.13.0/protoc-3.13.0-linux-x86_64.zip && \
32+
unzip -d /usr/local protoc-3.13.0-linux-x86_64.zip bin/protoc && \
3333
chmod 755 /usr/local/bin/protoc && \
34-
curl -O https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-1.14.0.tar.gz && \
35-
tar zxf libtensorflow-gpu-linux-x86_64-1.14.0.tar.gz -C /usr/local && \
34+
curl -O https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-2.3.0.tar.gz && \
35+
tar zxf libtensorflow-gpu-linux-x86_64-2.3.0.tar.gz -C /usr/local && \
3636
ldconfig
3737

3838
ENV LANG en_US.UTF-8

stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
resolver: lts-15.11
1+
resolver: lts-16.18
22

33
packages:
44
- tensorflow

tensorflow-core-ops/Setup.hs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,23 +105,33 @@ blackList =
105105
, "GroupByWindowDataset"
106106
, "If"
107107
, "InterleaveDataset"
108+
, "LegacyParallelInterleaveDatasetV2"
109+
, "LoadDataset"
108110
, "MapAndBatchDataset"
109111
, "MapAndBatchDatasetV2"
110112
, "MapDataset"
111113
, "MapDefun"
112114
, "OneShotIterator"
113115
, "ParallelInterleaveDataset"
114116
, "ParallelInterleaveDatasetV2"
117+
, "ParallelInterleaveDatasetV3"
118+
, "ParallelInterleaveDatasetV4"
115119
, "ParallelMapDataset"
120+
, "ParallelMapDatasetV2"
116121
, "ParseSequenceExample"
122+
, "ParseSequenceExampleV2"
123+
, "ParseSingleSequenceExample"
117124
, "PartitionedCall"
118125
, "ReduceDataset"
119126
, "RemoteCall"
127+
, "SaveDataset"
120128
, "ScanDataset"
129+
, "SnapshotDatasetV2"
121130
, "StatefulPartitionedCall"
122131
, "StatelessIf"
123132
, "StatelessWhile"
124133
, "SymbolicGradient"
134+
, "TakeWhileDataset"
125135
, "TPUPartitionedCall"
126136
, "TPUReplicate"
127137
, "While"
@@ -130,6 +140,7 @@ blackList =
130140
, "XlaReduce"
131141
, "XlaReduceWindow"
132142
, "XlaSelectAndScatter"
143+
, "XlaScatter"
133144
, "XlaWhile"
134145
, "_If"
135146
, "_TPUReplicate"

tensorflow-core-ops/tensorflow-core-ops.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ library
1616
exposed-modules: TensorFlow.GenOps.Core
1717
autogen-modules: TensorFlow.GenOps.Core
1818
build-depends: bytestring
19-
, proto-lens == 0.6.*
19+
, proto-lens == 0.7.*
2020
, tensorflow == 0.2.*
2121
, base >= 4.7 && < 5
2222
, lens-family == 2.*
@@ -27,7 +27,7 @@ custom-setup
2727
setup-depends: Cabal
2828
, bytestring
2929
, directory
30-
, proto-lens == 0.6.*
30+
, proto-lens == 0.7.*
3131
, tensorflow-opgen == 0.2.*
3232
, tensorflow == 0.2.*
3333
, base >= 4.7 && < 5

tensorflow-logging/tensorflow-logging.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ library
2424
, filepath
2525
, hostname
2626
, lens-family == 2.*
27-
, proto-lens == 0.6.*
27+
, proto-lens == 0.7.*
2828
, resourcet
2929
, stm
3030
, stm-chans

tensorflow-mnist/tensorflow-mnist.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ library
2020
exposed-modules: TensorFlow.Examples.MNIST.Parse
2121
, TensorFlow.Examples.MNIST.TrainedGraph
2222
other-modules: Paths_tensorflow_mnist
23-
build-depends: proto-lens == 0.6.*
23+
build-depends: proto-lens == 0.7.*
2424
, base >= 4.7 && < 5
2525
, binary
2626
, bytestring

tensorflow-opgen/src/TensorFlow/OpGen/ParsedOp.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ getExplicitInputAttr o implicitAttrs a
266266
, a ^. maybe'defaultValue == Nothing
267267
, t <- parseAttrType o (a ^. type')
268268
, t `elem` map AttrSingle
269-
[AttrBool, AttrInt64, AttrFloat, AttrType, AttrShape]
269+
[AttrBool, AttrInt64, AttrFloat, AttrType, AttrShape, AttrBytes]
270270
++ [AttrList AttrType] = Just t
271271
| otherwise = Nothing
272272

tensorflow-opgen/tensorflow-opgen.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ library
1616
hs-source-dirs: src
1717
exposed-modules: TensorFlow.OpGen.ParsedOp
1818
, TensorFlow.OpGen
19-
build-depends: proto-lens == 0.6.*
19+
build-depends: proto-lens == 0.7.*
2020
, tensorflow-proto == 0.2.*
2121
, base >= 4.7 && < 5
2222
, bytestring

0 commit comments

Comments
 (0)