未验证 提交 897f63b4 编写于 作者: L Leo Chen 提交者: GitHub

[new-exec] refine ut (#38798)

上级 5c73a6ea
...@@ -32,18 +32,16 @@ class LinearTestCase(unittest.TestCase): ...@@ -32,18 +32,16 @@ class LinearTestCase(unittest.TestCase):
self.place.set_place(place) self.place.set_place(place)
def build_program(self): def build_program(self):
a = paddle.static.data(name="a", shape=[2, 2], dtype='float32') startup_program = paddle.static.Program()
b = paddle.ones([2, 2]) * 2 main_program = paddle.static.Program()
t = paddle.static.nn.fc(a, 2) with paddle.static.program_guard(main_program, startup_program):
c = t + b a = paddle.static.data(name="a", shape=[2, 2], dtype='float32')
b = paddle.ones([2, 2]) * 2
main_program = paddle.fluid.default_main_program() t = paddle.static.nn.fc(a, 2)
startup_program = paddle.fluid.default_startup_program() c = t + b
return startup_program, main_program, c return startup_program, main_program, c
return standaloneexecutor, c
def test_interp_base(self): def test_interp_base(self):
startup_program, main_program, c = self.build_program() startup_program, main_program, c = self.build_program()
standaloneexecutor = StandaloneExecutor( standaloneexecutor = StandaloneExecutor(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册