From 818a64f41ffacca0d3ff07928a19ac47021ccac1 Mon Sep 17 00:00:00 2001 From: wanghaoshuang Date: Fri, 25 Aug 2017 13:56:55 +0800 Subject: [PATCH] Fix img_pool_layer bug. --- python/paddle/trainer_config_helpers/layers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/paddle/trainer_config_helpers/layers.py b/python/paddle/trainer_config_helpers/layers.py index f323b017c06..862265f2cde 100755 --- a/python/paddle/trainer_config_helpers/layers.py +++ b/python/paddle/trainer_config_helpers/layers.py @@ -2607,15 +2607,15 @@ def img_pool_layer(input, assert input.num_filters is not None num_channels = input.num_filters - assert type(pool_type) in [AvgPooling, MaxPooling, CudnnAvgPooling, - CudnnMaxPooling], \ - "only (Cudnn)AvgPooling, (Cudnn)MaxPooling are supported" - if pool_type is None: pool_type = MaxPooling() elif isinstance(pool_type, AvgPooling): pool_type.name = 'avg' + assert type(pool_type) in [AvgPooling, MaxPooling, CudnnAvgPooling, + CudnnMaxPooling], \ + "only (Cudnn)AvgPooling, (Cudnn)MaxPooling are supported" + type_name = pool_type.name + '-projection' \ if ( isinstance(pool_type, AvgPooling) or isinstance(pool_type, MaxPooling)) \ -- GitLab