未验证 提交 bc601f58 编写于 作者: J jzhang533 提交者: GitHub

fixing 55358 (#56448)

* fixing 55358

* correct codestyle
上级 4b1d28fc
...@@ -1721,12 +1721,6 @@ class Executor: ...@@ -1721,12 +1721,6 @@ class Executor:
"Please ensure you create model correctly or you can pass " "Please ensure you create model correctly or you can pass "
"the Program or the CompiledProgram manually." "the Program or the CompiledProgram manually."
) )
else:
error_info = (
"There are no operators in the program to be executed. "
"If you pass Program manually, please use base.program_guard "
"to ensure the current Program is being used."
)
warnings.warn(error_info) warnings.warn(error_info)
if scope is None: if scope is None:
......
...@@ -639,12 +639,15 @@ class TestLayerNormOp(unittest.TestCase): ...@@ -639,12 +639,15 @@ class TestLayerNormOp(unittest.TestCase):
program._sync_with_cpp() program._sync_with_cpp()
exe = base.Executor(place) exe = base.Executor(place)
name_list = ['x', 'y@GRAD']
if has_scale:
name_list += ['scale']
if has_bias:
name_list += ['bias']
out = exe.run( out = exe.run(
program, program,
feed={ feed={name: var_dict[name] for name in name_list},
name: var_dict[name]
for name in ['x', 'scale', 'bias', 'y@GRAD']
},
fetch_list=fetch_list, fetch_list=fetch_list,
) )
# print(y) # print(y)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册