未验证 提交 99331fa1 编写于 作者: H Huihuang Zheng 提交者: GitHub

Fix current block in math_patch_op (#21189)

上级 5af0c7ba
...@@ -42,8 +42,7 @@ def monkey_patch_variable(): ...@@ -42,8 +42,7 @@ def monkey_patch_variable():
def current_block(var): def current_block(var):
if in_dygraph_mode(): if in_dygraph_mode():
return default_main_program().global_block() return default_main_program().global_block()
else: return var.block.program.current_block()
return var.block
def create_new_tmp_var(block, dtype): def create_new_tmp_var(block, dtype):
tmp_name = unique_tmp_name() tmp_name = unique_tmp_name()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册