Skip to content

Commit 1f86c88

Browse files
committed
Remove random order of fetch_list in test_random_crop_op
1 parent e0d5f8a commit 1f86c88

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,11 @@ include(external/snappy) # download snappy
204204
include(external/snappystream)
205205
include(external/threadpool)
206206

207+
set(WITH_ANAKIN OFF CACHE STRING "Disable Anakin first, will add it later." FORCE)
207208
if(WITH_GPU)
208209
include(cuda)
209210
include(tensorrt)
210211
include(external/anakin)
211-
else()
212-
set(WITH_ANAKIN OFF CACHE STRING "Anakin is valid only when GPU is set." FORCE)
213212
endif()
214213

215214
include(cudnn) # set cudnn libraries, must before configure

python/paddle/fluid/tests/unittests/op_test.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,10 @@ def check_output(self, atol=1e-5):
362362

363363
def check_output_customized(self, checker):
364364
places = self._get_places()
365-
import sys
366-
print('places', places)
367365
for place in places:
368366
outs = self.calc_output(place)
369367
outs = [np.array(out) for out in outs]
370-
import sys
371-
print('outs', outs)
372-
sys.stdout.flush()
368+
outs.sort(key=len)
373369
checker(outs)
374370

375371
def __assert_is_close(self, numeric_grads, analytic_grads, names,

python/paddle/fluid/tests/unittests/test_random_crop_op.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ def setUp(self):
2323
to_crop = np.array([[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]] *
2424
5).astype(np.int32)
2525
self.possible_res = [
26-
np.array([[1, 2, 3], [5, 6, 7]]), np.array([[2, 3, 4], [6, 7, 8]]),
27-
np.array([[5, 6, 7], [9, 10, 11]]),
28-
np.array([[6, 7, 8], [10, 11, 12]])
26+
np.array([[1, 2, 3], [5, 6, 7]]).astype(np.int32),
27+
np.array([[2, 3, 4], [6, 7, 8]]).astype(np.int32),
28+
np.array([[5, 6, 7], [9, 10, 11]]).astype(np.int32),
29+
np.array([[6, 7, 8], [10, 11, 12]]).astype(np.int32)
2930
]
3031
self.op_type = "random_crop"
3132
self.inputs = {'X': to_crop, 'Seed': np.array([10])}

0 commit comments

Comments
 (0)