提交 1f86c88f 编写于 作者: M minqiyang

Remove random order of fetch_list in test_random_crop_op

上级 e0d5f8a8
......@@ -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
......
......@@ -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,
......
......@@ -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])}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册