From c5d1902223eba2631d08da5cb1dd2e24125b9be2 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Fri, 2 Sep 2016 17:21:58 +0800 Subject: [PATCH] Make helper shows the correct output value Change-Id: Ia5358f88129b5c2e2a2653b1d85c168b80d797b3 --- python/paddle/trainer_config_helpers/networks.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/paddle/trainer_config_helpers/networks.py b/python/paddle/trainer_config_helpers/networks.py index 94b5245ab..93c4261cc 100644 --- a/python/paddle/trainer_config_helpers/networks.py +++ b/python/paddle/trainer_config_helpers/networks.py @@ -1121,12 +1121,13 @@ def outputs(layers): logger.info( "".join(["The input order is [", ", ".join(final_inputs), "]"]) ) + + if len(final_outputs) == 0: + final_outputs = map(lambda x: x.name, layers) + logger.info( "".join(["The output order is [", ", ".join(final_outputs), "]" ])) Inputs(*final_inputs) - if len(final_outputs) != 0: - Outputs(*final_outputs) - else: - Outputs(*map(lambda x: x.name, layers)) + Outputs(*final_outputs) -- GitLab