Skip to content

Commit 7c57501

Browse files
committed
Add TensorFlow addons (TFA)
Note: TFA functionnality relying on Custom Op won't work. See: tensorflow/addons#987. BUG=145555176
1 parent a52fb15 commit 7c57501

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ RUN pip install /tmp/tensorflow_gcs_config/tensorflow*.whl && \
6565
rm -rf /tmp/tensorflow_gcs_config && \
6666
/tmp/clean-layer.sh
6767

68+
# Install TensorFlow addons (TFA).
69+
# TFA functionnality relying on Custom Op won't work. See: https://github.com/tensorflow/addons/issues/987.
70+
RUN pip install tensorflow-addons==0.10.0 && \
71+
/tmp/clean-layer.sh
72+
6873
RUN apt-get install -y libfreetype6-dev && \
6974
apt-get install -y libglib2.0-0 libxext6 libsm6 libxrender1 libfontconfig1 --fix-missing && \
7075
pip install gensim && \

tests/test_tensorflow_addons.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import unittest
2+
3+
import tensorflow as tf
4+
import tensorflow_addons as tfa
5+
6+
7+
class TestTensorflowAddons(unittest.TestCase):
8+
def test_tfa_image(self):
9+
img_raw = tf.io.read_file('/input/tests/data/dot.png')
10+
img = tf.io.decode_image(img_raw)
11+
img = tf.image.convert_image_dtype(img, tf.float32)
12+
mean = tfa.image.mean_filter2d(img, filter_shape=1)
13+
14+
self.assertEqual(1, len(mean))

0 commit comments

Comments
 (0)