Skip to content

Commit 2b66611

Browse files
authored
Merge pull request #817 from Kaggle/add-tfa-custom-op-test
Add a test exercising TFA custom op.
2 parents 57fb90f + 09a76b8 commit 2b66611

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/test_tensorflow_addons.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,12 @@ def test_tfa_image(self):
1111
img = tf.image.convert_image_dtype(img, tf.float32)
1212
mean = tfa.image.mean_filter2d(img, filter_shape=1)
1313

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

0 commit comments

Comments
 (0)