From 23e00ba37990f34981c80f25f5a66c18ba0154b4 Mon Sep 17 00:00:00 2001 From: Luo Tao Date: Wed, 17 May 2017 12:55:38 +0800 Subject: [PATCH] follow comments --- python/paddle/trainer/config_parser.py | 3 +++ python/paddle/trainer_config_helpers/layers.py | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/python/paddle/trainer/config_parser.py b/python/paddle/trainer/config_parser.py index 57d30b088b8..9135f38719a 100644 --- a/python/paddle/trainer/config_parser.py +++ b/python/paddle/trainer/config_parser.py @@ -2320,6 +2320,9 @@ def Memory(name, memory_name = name + "+delay1" agent_name = memory_name if is_sequence: + config_assert( + boot_layer is not None, + "there must be boot_layer in network when is_sequence = True") agent_layer = SequenceAgentLayer(agent_name, size) else: agent_layer = AgentLayer(agent_name, size) diff --git a/python/paddle/trainer_config_helpers/layers.py b/python/paddle/trainer_config_helpers/layers.py index dcf1c05bd6a..3b6f0270de1 100755 --- a/python/paddle/trainer_config_helpers/layers.py +++ b/python/paddle/trainer_config_helpers/layers.py @@ -2916,8 +2916,6 @@ def memory(name, boot_bias = ParamAttr.to_bias(boot_bias) assert boot_layer is None or isinstance(boot_layer, LayerOutput) - if is_seq == True: - assert isinstance(boot_layer, LayerOutput) if name is not None: memory_name = None -- GitLab