Skip to content

Commit

Permalink
Add one unit test to cover empty tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
cchung100m committed Aug 16, 2019
1 parent 8f81c45 commit 2bea7a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/python/frontend/tflite/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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), ())


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

0 comments on commit 2bea7a3

Please sign in to comment.