未验证 提交 92708a27 编写于 作者: W wanghuancoder 提交者: GitHub

modify test_load_op save path from /tmp to ./ (#27872)

* modify test_load_op save path from /tmp to ./, test=develop

* trigger kunlun ci, test=kunlun

* trigger kunlun ci, test=kunlun
上级 9637d963
...@@ -41,14 +41,14 @@ class TestLoadOp(unittest.TestCase): ...@@ -41,14 +41,14 @@ class TestLoadOp(unittest.TestCase):
exe = fluid.Executor(fluid.CPUPlace()) exe = fluid.Executor(fluid.CPUPlace())
exe.run(start_prog) exe.run(start_prog)
fluid.io.save_persistables( fluid.io.save_persistables(
exe, dirname="/tmp/model", main_program=main_prog) exe, dirname="./model", main_program=main_prog)
def test_load(self): def test_load(self):
main_prog = fluid.Program() main_prog = fluid.Program()
start_prog = fluid.Program() start_prog = fluid.Program()
with fluid.program_guard(main_prog, start_prog): with fluid.program_guard(main_prog, start_prog):
var = layers.create_tensor(dtype='float32') var = layers.create_tensor(dtype='float32')
layers.load(var, file_path='/tmp/model/w') layers.load(var, file_path='./model/w')
exe = fluid.Executor(fluid.CPUPlace()) exe = fluid.Executor(fluid.CPUPlace())
exe.run(start_prog) exe.run(start_prog)
......
...@@ -44,14 +44,14 @@ class TestLoadOpXpu(unittest.TestCase): ...@@ -44,14 +44,14 @@ class TestLoadOpXpu(unittest.TestCase):
exe = fluid.Executor(fluid.XPUPlace(0)) exe = fluid.Executor(fluid.XPUPlace(0))
exe.run(start_prog) exe.run(start_prog)
fluid.io.save_persistables( fluid.io.save_persistables(
exe, dirname="/tmp/model", main_program=main_prog) exe, dirname="./model", main_program=main_prog)
def test_load_xpu(self): def test_load_xpu(self):
main_prog = fluid.Program() main_prog = fluid.Program()
start_prog = fluid.Program() start_prog = fluid.Program()
with fluid.program_guard(main_prog, start_prog): with fluid.program_guard(main_prog, start_prog):
var = layers.create_tensor(dtype='float32') var = layers.create_tensor(dtype='float32')
layers.load(var, file_path='/tmp/model/w') layers.load(var, file_path='./model/w')
exe = fluid.Executor(fluid.XPUPlace(0)) exe = fluid.Executor(fluid.XPUPlace(0))
exe.run(start_prog) exe.run(start_prog)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册