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

fixing 55358 (#56448)

* fixing 55358

* correct codestyle
上级 4b1d28fc
......@@ -1721,13 +1721,7 @@ class Executor:
"Please ensure you create model correctly or you can pass "
"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:
scope = global_scope()
......
......@@ -639,12 +639,15 @@ class TestLayerNormOp(unittest.TestCase):
program._sync_with_cpp()
exe = base.Executor(place)
name_list = ['x', 'y@GRAD']
if has_scale:
name_list += ['scale']
if has_bias:
name_list += ['bias']
out = exe.run(
program,
feed={
name: var_dict[name]
for name in ['x', 'scale', 'bias', 'y@GRAD']
},
feed={name: var_dict[name] for name in name_list},
fetch_list=fetch_list,
)
# print(y)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册