From c716cf353e3a5060324a2e1de6653934f8419d7e Mon Sep 17 00:00:00 2001 From: 0x45f <23097963+0x45f@users.noreply.github.com> Date: Thu, 28 Oct 2021 20:09:20 +0800 Subject: [PATCH] polish _remove_no_value_return_var() function (#36826) (#36830) --- .../paddle/fluid/dygraph/dygraph_to_static/convert_operators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py b/python/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py index d27af5c0dd..0ac4da947a 100644 --- a/python/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py +++ b/python/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py @@ -214,7 +214,7 @@ def convert_ifelse(pred, true_fn, false_fn, true_args, false_args, return_vars): def _remove_no_value_return_var(out): - if out and isinstance(out, tuple): + if isinstance(out, tuple) and len(out) > 0: processed_out = out align_ret = out[0] if isinstance(align_ret, tuple): -- GitLab