diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index 0fa79f02ab8143389105878a83474b6fc2bbe462..23aaa90d68d95a7584173b103422bd273b22393d 100644 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -394,8 +394,7 @@ foreach(TEST_OP ${TEST_OPS}) py_test_modules(${TEST_OP} MODULES ${TEST_OP}) endforeach(TEST_OP) py_test_modules(test_adam_op_multi_thread MODULES test_adam_op ENVS FLAGS_inner_op_parallelism=4) -# disable test_warpctc_op -# py_test_modules(test_warpctc_op MODULES test_warpctc_op) +py_test_modules(test_warpctc_op MODULES test_warpctc_op) py_test_modules(test_bilinear_interp_op MODULES test_bilinear_interp_op ENVS ${GC_ENVS}) py_test_modules(test_nearest_interp_op MODULES test_nearest_interp_op ENVS ${GC_ENVS}) py_test_modules(test_imperative_resnet MODULES test_imperative_resnet ENVS diff --git a/python/paddle/fluid/tests/unittests/test_warpctc_op.py b/python/paddle/fluid/tests/unittests/test_warpctc_op.py index b82ab04c9860de88a142ac31e5934202463d3073..6310a76d8d000ad05fd3a0d3dd7e4a2ac4d15f1a 100644 --- a/python/paddle/fluid/tests/unittests/test_warpctc_op.py +++ b/python/paddle/fluid/tests/unittests/test_warpctc_op.py @@ -24,6 +24,8 @@ from paddle.fluid import Program, program_guard import paddle import paddle.nn.functional as F +paddle.enable_static() + CUDA_BLOCK_SIZE = 32 @@ -490,8 +492,8 @@ class TestWarpCTCOpError(unittest.TestCase): logits = np.random.uniform(0.1, 1.0, [20, 15]).astype("float32") # labels should not be blank labels = np.random.randint(0, 15 - 1, [15, 1], dtype="int32") - softmax = paddle.to_variable(logits) - labels = paddle.to_variable(labels) + softmax = paddle.to_tensor(logits) + labels = paddle.to_tensor(labels) fluid.layers.warpctc(input=softmax, label=labels)