From 1a8fcc00de74ac2d54297472a13fb4cb410dc34d Mon Sep 17 00:00:00 2001 From: dangqingqing Date: Wed, 23 Nov 2016 11:01:12 +0800 Subject: [PATCH] fix the code style --- python/paddle/trainer/config_parser.py | 36 ++++++++++++++------------ 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/python/paddle/trainer/config_parser.py b/python/paddle/trainer/config_parser.py index 1d5e0459b49..9db42bf172a 100644 --- a/python/paddle/trainer/config_parser.py +++ b/python/paddle/trainer/config_parser.py @@ -592,6 +592,7 @@ class DotMulProjection(Projection): def calc_parameter_dims(self, input_size, output_size): return [1, output_size] + # ScalingProjection @config_class class ScalingProjection(Projection): @@ -808,17 +809,18 @@ class BilinearInterp(Cfg): # please refer to the comments in proto/ModelConfig.proto @config_class class Pool(Cfg): - def __init__(self, - pool_type, - channels, - size_x, - size_y=None, - img_width=None, - start=None, - stride=None, # 1 by defalut in protobuf - stride_y=None, - padding=None, # 0 by defalut in protobuf - padding_y=None): + def __init__( + self, + pool_type, + channels, + size_x, + size_y=None, + img_width=None, + start=None, + stride=None, # 1 by defalut in protobuf + stride_y=None, + padding=None, # 0 by defalut in protobuf + padding_y=None): self.add_keys(locals()) @@ -1114,12 +1116,12 @@ def parse_pool(pool, input_layer_name, pool_conf): if pool.padding is not None: pool_conf.padding = pool.padding pool_conf.padding_y = default(pool.padding_y, pool_conf.padding) - pool_conf.output_x = cnn_output_size( - pool_conf.img_size, pool_conf.size_x, pool_conf.padding, - pool_conf.stride, False) - pool_conf.output_y = cnn_output_size( - pool_conf.img_size_y, pool_conf.size_y, pool_conf.padding_y, - pool_conf.stride_y, False) + pool_conf.output_x = cnn_output_size(pool_conf.img_size, pool_conf.size_x, + pool_conf.padding, pool_conf.stride, + False) + pool_conf.output_y = cnn_output_size(pool_conf.img_size_y, pool_conf.size_y, + pool_conf.padding_y, + pool_conf.stride_y, False) def parse_spp(spp, input_layer_name, spp_conf): -- GitLab