From 2a7791a8153566a261b881c927a8ade42addc7e3 Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Fri, 13 Mar 2020 19:51:29 +0800 Subject: [PATCH] Fix travic ci (#23002) * fix the travic ci problem --- python/paddle/fluid/tests/unittests/gradient_checker.py | 2 +- python/paddle/fluid/tests/unittests/test_inference_api.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/gradient_checker.py b/python/paddle/fluid/tests/unittests/gradient_checker.py index d3e285d3a6..633fea1710 100644 --- a/python/paddle/fluid/tests/unittests/gradient_checker.py +++ b/python/paddle/fluid/tests/unittests/gradient_checker.py @@ -309,7 +309,7 @@ def grad_check(x, _compute_analytical_jacobian(prog, clone_x, clone_y, place, scope)) for i, (x_idx, - y_idx) in enumerate(product(*[range(len(x)), range(len(y))])): + y_idx) in enumerate(product(* [range(len(x)), range(len(y))])): a = analytical[y_idx][x_idx] n = numerical[x_idx][y_idx] if not np.allclose(a, n, rtol, atol): diff --git a/python/paddle/fluid/tests/unittests/test_inference_api.py b/python/paddle/fluid/tests/unittests/test_inference_api.py index c6491b719a..a74771211f 100644 --- a/python/paddle/fluid/tests/unittests/test_inference_api.py +++ b/python/paddle/fluid/tests/unittests/test_inference_api.py @@ -24,7 +24,7 @@ class TestInferenceApi(unittest.TestCase): def test_inference_api(self): tensor32 = np.random.randint(10, 20, size=[20, 2]).astype('int32') paddletensor32 = PaddleTensor(tensor32) - value32 = np.array(paddletensor32.data.int32_data()).reshape(*[20, 2]) + value32 = np.array(paddletensor32.data.int32_data()).reshape(* [20, 2]) dtype32 = paddletensor32.dtype self.assertEqual(value32.all(), tensor32.all()) self.assertEqual(dtype32, PaddleDType.INT32) @@ -38,7 +38,7 @@ class TestInferenceApi(unittest.TestCase): tensor64 = np.random.randint(10, 20, size=[20, 2]).astype('int64') paddletensor64 = PaddleTensor(tensor64) - value64 = np.array(paddletensor64.data.int64_data()).reshape(*[20, 2]) + value64 = np.array(paddletensor64.data.int64_data()).reshape(* [20, 2]) dtype64 = paddletensor64.dtype self.assertEqual(value64.all(), tensor64.all()) self.assertEqual(dtype64, PaddleDType.INT64) @@ -53,7 +53,7 @@ class TestInferenceApi(unittest.TestCase): tensor_float = np.random.randn(20, 2).astype('float32') paddletensor_float = PaddleTensor(tensor_float) value_float = np.array(paddletensor_float.data.float_data()).reshape( - *[20, 2]) + * [20, 2]) dtype_float = paddletensor_float.dtype self.assertEqual(value_float.all(), tensor_float.all()) self.assertEqual(dtype_float, PaddleDType.FLOAT32) -- GitLab