Skip to content

Commit 828d03d

Browse files
committed
Add a test exercising TFA custom op.
To prevent future regression. BUG=145555176
1 parent 57fb90f commit 828d03d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/test_tensorflow_addons.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import unittest
22

3+
import numpy as np
34
import tensorflow as tf
45
import tensorflow_addons as tfa
56

@@ -11,4 +12,12 @@ def test_tfa_image(self):
1112
img = tf.image.convert_image_dtype(img, tf.float32)
1213
mean = tfa.image.mean_filter2d(img, filter_shape=1)
1314

14-
self.assertEqual(1, len(mean))
15+
self.assertEqual(1, len(mean))
16+
17+
# This test exercises TFA Custom Op. See: b/145555176
18+
def test_gelu(self):
19+
x = tf.constant([[0.5, 1.2, -0.3]])
20+
layer = tfa.layers.GELU()
21+
result = layer(x)
22+
23+
self.assertEqual((1, 3), result.shape)

0 commit comments

Comments
 (0)