From 58c47e8d55fdef939b833bb7d03ff5b2d7080440 Mon Sep 17 00:00:00 2001 From: Aurelius84 Date: Mon, 7 Nov 2022 10:40:34 +0800 Subject: [PATCH] [Cherry-pick][BugFix]Fix set_attr modify underly type (#47500) (#47566) * Fix set_attr modify underly type (#47500) * reformat code * Revert "reformat code" This reverts commit f11a5d7658633e53c279f11612254937e2d87feb. --- python/paddle/fluid/framework.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/fluid/framework.py b/python/paddle/fluid/framework.py index cc05ec3297a..6e03d582600 100644 --- a/python/paddle/fluid/framework.py +++ b/python/paddle/fluid/framework.py @@ -6106,7 +6106,7 @@ class Program(object): for j in six.moves.range(block.op_size()): op = block.op(j) if op.has_attr('is_test'): - op._set_attr('is_test', True) + op._set_bool_attr('is_test', True) if op.type() == "batch_norm": # Remove the output ReserveSpace of batch_norm if exists. op.remove_output("ReserveSpace") -- GitLab