From adb28d67cb3bdb7c24c03fd60fa272fe22f6a604 Mon Sep 17 00:00:00 2001 From: 0x45f <23097963+0x45f@users.noreply.github.com> Date: Thu, 28 Oct 2021 15:56:51 +0800 Subject: [PATCH] polish _remove_no_value_return_var() function (#36826) --- .../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 d27af5c0dd9..0ac4da947a4 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