From fa54d9d8c03e4061528c4e3ad154b806cd0c35e7 Mon Sep 17 00:00:00 2001 From: wanghaoshuang Date: Thu, 7 Sep 2017 17:03:15 +0800 Subject: [PATCH] Rename attribute name in proto --- paddle/gserver/layers/SwitchOrderLayer.cpp | 8 ++++---- paddle/gserver/tests/test_LayerGrad.cpp | 8 ++++---- proto/ModelConfig.proto | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/paddle/gserver/layers/SwitchOrderLayer.cpp b/paddle/gserver/layers/SwitchOrderLayer.cpp index 5b2cfe3c48..92cd61cdd5 100644 --- a/paddle/gserver/layers/SwitchOrderLayer.cpp +++ b/paddle/gserver/layers/SwitchOrderLayer.cpp @@ -32,11 +32,11 @@ bool SwitchOrderLayer::init(const LayerMap& layerMap, outDims_ = TensorShape(4); auto& reshape_conf = config_.reshape_conf(); - for (int i = 0; i < reshape_conf.heightaxis_size(); i++) { - heightAxis_.push_back(reshape_conf.heightaxis(i)); + for (int i = 0; i < reshape_conf.height_axis_size(); i++) { + heightAxis_.push_back(reshape_conf.height_axis(i)); } - for (int i = 0; i < reshape_conf.widthaxis_size(); i++) { - widthAxis_.push_back(reshape_conf.widthaxis(i)); + for (int i = 0; i < reshape_conf.width_axis_size(); i++) { + widthAxis_.push_back(reshape_conf.width_axis(i)); } createFunction(nchw2nhwc_, "NCHW2NHWC", FuncConfig()); createFunction(nhwc2nchw_, "NHWC2NCHW", FuncConfig()); diff --git a/paddle/gserver/tests/test_LayerGrad.cpp b/paddle/gserver/tests/test_LayerGrad.cpp index e0c14ad5b5..d1f3bc241f 100644 --- a/paddle/gserver/tests/test_LayerGrad.cpp +++ b/paddle/gserver/tests/test_LayerGrad.cpp @@ -2019,10 +2019,10 @@ TEST(Layer, SwitchOrderLayer) { img->set_img_size_y(16); ReshapeConfig* reshape = config.layerConfig.mutable_reshape_conf(); - reshape->add_heightaxis(0); - reshape->add_heightaxis(1); - reshape->add_heightaxis(2); - reshape->add_widthaxis(3); + reshape->add_height_axis(0); + reshape->add_height_axis(1); + reshape->add_height_axis(2); + reshape->add_width_axis(3); // config softmax layer config.layerConfig.set_type("switch_order"); diff --git a/proto/ModelConfig.proto b/proto/ModelConfig.proto index 0f44d8cb8d..7d7fc23a46 100644 --- a/proto/ModelConfig.proto +++ b/proto/ModelConfig.proto @@ -288,8 +288,8 @@ message PadConfig { } message ReshapeConfig { - repeated uint32 heightAxis = 1; - repeated uint32 widthAxis = 2; + repeated uint32 height_axis = 1; + repeated uint32 width_axis = 2; } message MultiBoxLossConfig { -- GitLab