未验证 提交 ba7c62f8 编写于 作者: Z Zheng-Bicheng 提交者: GitHub

[Test Mv] python/paddle/fluid/tests to test/legacy_test (#51944)

update
上级 0da62ab7
......@@ -16,7 +16,6 @@ import contextlib
import unittest
import numpy as np
from unittests.test_imperative_base import new_program_scope
import paddle
import paddle.fluid as fluid
......@@ -27,6 +26,17 @@ from paddle.fluid.framework import Program, program_guard
paddle.enable_static()
@contextlib.contextmanager
def new_program_scope(main=None, startup=None, scope=None):
prog = main if main else fluid.Program()
startup_prog = startup if startup else fluid.Program()
scope = scope if scope else fluid.core.Scope()
with fluid.scope_guard(scope):
with fluid.program_guard(prog, startup_prog):
with fluid.unique_name.guard():
yield
class LayerTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册