From 1f86c88f4afaa3c2ea2bd9baabce521cc943e451 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Tue, 14 Aug 2018 21:51:06 +0800 Subject: [PATCH] Remove random order of fetch_list in test_random_crop_op --- CMakeLists.txt | 3 +-- python/paddle/fluid/tests/unittests/op_test.py | 6 +----- python/paddle/fluid/tests/unittests/test_random_crop_op.py | 7 ++++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f56c5d382af..920c20d6f81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,12 +204,11 @@ include(external/snappy) # download snappy include(external/snappystream) include(external/threadpool) +set(WITH_ANAKIN OFF CACHE STRING "Disable Anakin first, will add it later." FORCE) if(WITH_GPU) include(cuda) include(tensorrt) include(external/anakin) -else() - set(WITH_ANAKIN OFF CACHE STRING "Anakin is valid only when GPU is set." FORCE) endif() include(cudnn) # set cudnn libraries, must before configure diff --git a/python/paddle/fluid/tests/unittests/op_test.py b/python/paddle/fluid/tests/unittests/op_test.py index ada4ad70f0c..75373ae2e15 100644 --- a/python/paddle/fluid/tests/unittests/op_test.py +++ b/python/paddle/fluid/tests/unittests/op_test.py @@ -362,14 +362,10 @@ class OpTest(unittest.TestCase): def check_output_customized(self, checker): places = self._get_places() - import sys - print('places', places) for place in places: outs = self.calc_output(place) outs = [np.array(out) for out in outs] - import sys - print('outs', outs) - sys.stdout.flush() + outs.sort(key=len) checker(outs) def __assert_is_close(self, numeric_grads, analytic_grads, names, diff --git a/python/paddle/fluid/tests/unittests/test_random_crop_op.py b/python/paddle/fluid/tests/unittests/test_random_crop_op.py index 1acd377b1f9..27e5db4991b 100644 --- a/python/paddle/fluid/tests/unittests/test_random_crop_op.py +++ b/python/paddle/fluid/tests/unittests/test_random_crop_op.py @@ -23,9 +23,10 @@ class TestRandomCropOp(OpTest): to_crop = np.array([[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]] * 5).astype(np.int32) self.possible_res = [ - np.array([[1, 2, 3], [5, 6, 7]]), np.array([[2, 3, 4], [6, 7, 8]]), - np.array([[5, 6, 7], [9, 10, 11]]), - np.array([[6, 7, 8], [10, 11, 12]]) + np.array([[1, 2, 3], [5, 6, 7]]).astype(np.int32), + np.array([[2, 3, 4], [6, 7, 8]]).astype(np.int32), + np.array([[5, 6, 7], [9, 10, 11]]).astype(np.int32), + np.array([[6, 7, 8], [10, 11, 12]]).astype(np.int32) ] self.op_type = "random_crop" self.inputs = {'X': to_crop, 'Seed': np.array([10])} -- GitLab