Skip to content

Commit

Permalink
Testcase check added to run in tf version above 1.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
siju-samuel committed Feb 24, 2020
1 parent e32831f commit c90efcd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/python/frontend/tflite/test_forward.py
Expand Up @@ -1108,10 +1108,13 @@ def _test_reduce_any(data, keep_dims=None):
return _test_reduce(math_ops.reduce_any, data, keep_dims)


def _test_forward_reduce(testop, dtype="float32"):
def _test_forward_reduce(testop, dtype=None):
""" Reduce """
data0 = [np.random.rand(16, 16, 16, 16).astype(dtype), None]
data1 = [np.random.rand(16, 16, 16, 16).astype(dtype), np.array([1, 2], dtype=np.int32)]
data0 = [np.random.rand(16, 16, 16, 16).astype("float32"), None]
data1 = [np.random.rand(16, 16, 16, 16).astype("float32"), np.array([1, 2], dtype=np.int32)]
if dtype == 'bool':
data0[0] = (data0[0] < 0.5).astype(dtype)
data1[0] = (data1[0] < 0.5).astype(dtype)
testop(data0)
testop(data0, keep_dims=False)
testop(data0, keep_dims=True)
Expand All @@ -1132,7 +1135,8 @@ def test_all_reduce():
_test_forward_reduce_quantized(_test_reduce_mean)
_test_forward_reduce(_test_reduce_prod)
_test_forward_reduce(_test_reduce_sum)
_test_forward_reduce(_test_reduce_any, dtype="bool")
if package_version.parse(tf.VERSION) >= package_version.parse('1.15.0'):
_test_forward_reduce(_test_reduce_any, dtype="bool")


#######################################################################
Expand Down

0 comments on commit c90efcd

Please sign in to comment.