From c40b98e06857701137d54a20b6a0981560906b1f Mon Sep 17 00:00:00 2001 From: Huihuang Zheng Date: Thu, 4 Mar 2021 13:54:11 +0800 Subject: [PATCH] Fix comment (#31424) Fix wrong code comment --- .../fluid/dygraph/dygraph_to_static/loop_transformer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/dygraph/dygraph_to_static/loop_transformer.py b/python/paddle/fluid/dygraph/dygraph_to_static/loop_transformer.py index 979808267c7..b7ef000938a 100644 --- a/python/paddle/fluid/dygraph/dygraph_to_static/loop_transformer.py +++ b/python/paddle/fluid/dygraph/dygraph_to_static/loop_transformer.py @@ -54,8 +54,8 @@ def create_while_nodes(condition_name, body_name, loop_var_names): where a, b, c are in loop_var_names. - However, if loop_var_names contains attribute such as foo.x, we cannot - assign the attribute as output of convert_while_loop because Python + However, if loop_var_names contains property such as foo.x, we cannot + assign the property as output of convert_while_loop because Python property is a kind of read-only attribute. To handle the case, we replace the attributes which are output of convert_while_loop with generated variables, then if we know the attribute is not read-only at runtime, we -- GitLab