未验证 提交 b0706ef6 编写于 作者: W wangxinxin08 提交者: GitHub

modify uts in test_ops.py (#1643)

上级 a3364163
...@@ -491,9 +491,7 @@ class TestPriorBox(LayerTest): ...@@ -491,9 +491,7 @@ class TestPriorBox(LayerTest):
self.assertTrue(np.array_equal(var_np, var_dy_np)) self.assertTrue(np.array_equal(var_np, var_dy_np))
def test_prior_box_error(self): def test_prior_box_error(self):
program = Program() with self.static_graph():
paddle.enable_static()
with program_guard(program):
input = paddle.static.data( input = paddle.static.data(
name='input', shape=[2, 10, 32, 32], dtype='int32') name='input', shape=[2, 10, 32, 32], dtype='int32')
image = paddle.static.data( image = paddle.static.data(
...@@ -603,9 +601,7 @@ class TestMulticlassNms(LayerTest): ...@@ -603,9 +601,7 @@ class TestMulticlassNms(LayerTest):
self.assertTrue(np.array_equal(nms_rois_num_np, nms_rois_num_dy_np)) self.assertTrue(np.array_equal(nms_rois_num_np, nms_rois_num_dy_np))
def test_multiclass_nms_error(self): def test_multiclass_nms_error(self):
program = Program() with self.static_graph():
paddle.enable_static()
with program_guard(program):
boxes = paddle.static.data( boxes = paddle.static.data(
name='bboxes', shape=[81, 4], dtype='float32', lod_level=1) name='bboxes', shape=[81, 4], dtype='float32', lod_level=1)
scores = paddle.static.data( scores = paddle.static.data(
...@@ -683,9 +679,7 @@ class TestMatrixNMS(LayerTest): ...@@ -683,9 +679,7 @@ class TestMatrixNMS(LayerTest):
self.assertTrue(np.array_equal(index_np, index_dy_np)) self.assertTrue(np.array_equal(index_np, index_dy_np))
def test_matrix_nms_error(self): def test_matrix_nms_error(self):
paddle.enable_static() with self.static_graph():
program = Program()
with program_guard(program):
bboxes = paddle.static.data( bboxes = paddle.static.data(
name='bboxes', shape=[7, 1200, 4], dtype='float32') name='bboxes', shape=[7, 1200, 4], dtype='float32')
scores = paddle.static.data( scores = paddle.static.data(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册