未验证 提交 3125733a 编写于 作者: W Weilong Wu 提交者: GitHub

rm _disable_legacy_dygraph and disable one mkldnn test file (#48721)

* rm _disable_legacy_dygraph

* disable test_flags_mkldnn_ops_on_off test
上级 d050c188
......@@ -5,6 +5,7 @@ file(
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
list(REMOVE_ITEM TEST_OPS "test_onnx_format_quantization_mobilenetv1")
list(REMOVE_ITEM TEST_OPS "test_flags_mkldnn_ops_on_off")
if(WITH_MKLDNN AND NOT WIN32)
list(APPEND TEST_OPS "test_onnx_format_quantization_mobilenetv1")
......@@ -19,4 +20,4 @@ if(WITH_MKLDNN AND NOT WIN32)
set_tests_properties(test_onnx_format_quantization_mobilenetv1
PROPERTIES TIMEOUT 300)
endif()
set_tests_properties(test_flags_mkldnn_ops_on_off PROPERTIES TIMEOUT 120)
# set_tests_properties(test_flags_mkldnn_ops_on_off PROPERTIES TIMEOUT 120)
......@@ -18,11 +18,9 @@ import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid.framework import _enable_legacy_dygraph, _global_flags
from paddle.fluid.framework import _global_flags
from paddle.fluid.layer_helper import LayerHelper
_enable_legacy_dygraph()
def check():
print(
......
......@@ -22,7 +22,6 @@ from decorator_helper import prog_scope
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
import paddle.fluid.framework as framework
import paddle.fluid.layers as layers
from paddle.fluid import Program, program_guard
from paddle.fluid.backward import append_backward
......@@ -42,7 +41,6 @@ class TestAssignOp(op_test.OpTest):
self.check_output(check_eager=True)
fluid.set_flags({"FLAGS_retain_grad_for_all_tensor": False})
paddle.disable_static()
framework._disable_legacy_dygraph()
def test_backward(self):
paddle.enable_static()
......@@ -50,7 +48,6 @@ class TestAssignOp(op_test.OpTest):
self.check_grad(['X'], 'Out', check_eager=True)
fluid.set_flags({"FLAGS_retain_grad_for_all_tensor": False})
paddle.disable_static()
framework._disable_legacy_dygraph()
class TestAssignFP16Op(op_test.OpTest):
......@@ -67,7 +64,6 @@ class TestAssignFP16Op(op_test.OpTest):
self.check_output(check_eager=True)
fluid.set_flags({"FLAGS_retain_grad_for_all_tensor": False})
paddle.disable_static()
framework._disable_legacy_dygraph()
def test_backward(self):
paddle.enable_static()
......@@ -75,7 +71,6 @@ class TestAssignFP16Op(op_test.OpTest):
self.check_grad(['X'], 'Out', check_eager=True)
fluid.set_flags({"FLAGS_retain_grad_for_all_tensor": False})
paddle.disable_static()
framework._disable_legacy_dygraph()
class TestAssignOpWithLoDTensorArray(unittest.TestCase):
......
......@@ -73,7 +73,6 @@ class LinalgLstsqTestCase(unittest.TestCase):
def test_eager_dygraph(self):
paddle.disable_static()
paddle.fluid.framework._disable_legacy_dygraph()
for dev in self.devices:
paddle.set_device(dev)
place = paddle.CPUPlace() if dev == "cpu" else paddle.CUDAPlace(0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册