From 06e264abcd4db6a2bed234fe3e5b1a0bc6642baa Mon Sep 17 00:00:00 2001 From: cchung100m Date: Sat, 10 Aug 2019 00:02:48 +0800 Subject: [PATCH] Add one unit test to cover empty tuple --- tests/python/frontend/tflite/test_forward.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/python/frontend/tflite/test_forward.py b/tests/python/frontend/tflite/test_forward.py index e6bab3ebbb8a4..a78225cd56466 100644 --- a/tests/python/frontend/tflite/test_forward.py +++ b/tests/python/frontend/tflite/test_forward.py @@ -206,13 +206,13 @@ def test_forward_split(): # --------- -def _test_forward_transpose(ishape, axes=None): +def _test_forward_transpose(ishape, axes=()): data = np.random.uniform(size=ishape).astype(np.float32) with tf.Graph().as_default(): in_data = array_ops.placeholder(shape=data.shape, dtype=data.dtype) - if axes is None: + if not axes: out = array_ops.transpose(in_data) else: out = array_ops.transpose(in_data, axes) @@ -227,6 +227,7 @@ def test_forward_transpose(): _test_forward_transpose((2, 3, 4), (1, 2, 0)) _test_forward_transpose((2, 3, 4), (0, 1, 2)) _test_forward_transpose((2, 3, 4, 5), (3, 0, 1, 2)) + _test_forward_transpose((2, 3, 4, 5), ()) #######################################################################