未验证 提交 6a1e4de2 编写于 作者: A Aurelius84 提交者: GitHub

Fix default behavior if block=None in static mode (#37827)

上级 5b1ad140
......@@ -53,11 +53,7 @@ class Initializer(object):
def _check_block(self, block):
if block is None:
if in_dygraph_mode():
block = default_main_program().global_block()
else:
raise ValueError(
"The parameter 'block' is needed in static graph mode.")
block = default_main_program().global_block()
return block
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册