From a52d5d5095ac7af494400947d4aace90f8309adc Mon Sep 17 00:00:00 2001 From: jerrywgz Date: Thu, 14 Feb 2019 02:31:39 +0000 Subject: [PATCH] refine unittest, test=develop --- python/paddle/fluid/tests/unittests/test_expand_op.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_expand_op.py b/python/paddle/fluid/tests/unittests/test_expand_op.py index 218fc697f2..690875662e 100644 --- a/python/paddle/fluid/tests/unittests/test_expand_op.py +++ b/python/paddle/fluid/tests/unittests/test_expand_op.py @@ -112,7 +112,10 @@ class TestExpandOpRank4(OpTest): class TestExpandOpInteger(OpTest): def setUp(self): self.op_type = "expand" - self.inputs = {'X': np.random.random((2, 4, 5)).astype("int32")} + self.inputs = { + 'X': np.random.randint( + 10, size=(2, 4, 5)).astype("int32") + } self.attrs = {'expand_times': [2, 1, 4]} output = np.tile(self.inputs['X'], (2, 1, 4)) self.outputs = {'Out': output} @@ -124,7 +127,7 @@ class TestExpandOpInteger(OpTest): class TestExpandOpBoolean(OpTest): def setUp(self): self.op_type = "expand" - self.inputs = {'X': np.random.random((2, 4, 5)).astype("bool")} + self.inputs = {'X': np.random.randint(2, size=(2, 4, 5)).astype("bool")} self.attrs = {'expand_times': [2, 1, 4]} output = np.tile(self.inputs['X'], (2, 1, 4)) self.outputs = {'Out': output} -- GitLab