From 99331fa1131b8b3f33e2f56e8ee9eaae76824078 Mon Sep 17 00:00:00 2001 From: Huihuang Zheng Date: Wed, 11 Dec 2019 10:05:30 +0800 Subject: [PATCH] Fix current block in math_patch_op (#21189) --- python/paddle/fluid/layers/math_op_patch.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/paddle/fluid/layers/math_op_patch.py b/python/paddle/fluid/layers/math_op_patch.py index be7bf69c30..73ae377ac3 100644 --- a/python/paddle/fluid/layers/math_op_patch.py +++ b/python/paddle/fluid/layers/math_op_patch.py @@ -42,8 +42,7 @@ def monkey_patch_variable(): def current_block(var): if in_dygraph_mode(): return default_main_program().global_block() - else: - return var.block + return var.block.program.current_block() def create_new_tmp_var(block, dtype): tmp_name = unique_tmp_name() -- GitLab