diff --git a/doc_cn/howto/how_to_write_docs/index.rst b/doc_cn/howto/how_to_write_docs/index.rst
new file mode 100644
index 0000000000000000000000000000000000000000..869ef747f9f88c7dbb5efdf6e03111a3f76c4014
--- /dev/null
+++ b/doc_cn/howto/how_to_write_docs/index.rst
@@ -0,0 +1,63 @@
+###############################
+如何贡献/修改PaddlePaddle的文档
+###############################
+
+PaddlePaddle的文档使用 `cmake`_ 驱动 `sphinx`_ 生成。公有两个文档,:code:`doc` 和 :code:`doc_cn` 。这两者会在 `cmake`_ 中进行编译,生成后的文档会存储在服务器的 :code:`doc` 和 :code:`doc_cn` 两个目录下。
+
+下面分几个部分介绍一下PaddlePaddle文档的贡献方法。
+
+如何书写PaddlePaddle的文档
+==========================
+
+TBD
+
+如何构建PaddlePaddle的文档
+==========================
+
+构建PaddlePaddle文档,需要使用构建Paddle的全部环境。准备这个环境相对来说比较复杂,所以本文档提供两种方式构建PaddlePaddle的文档,即
+
+* 使用Docker构建PaddlePaddle的文档
+* 直接构建PaddlePaddle的文档。
+
+并且,我们推荐使用Docker来构建PaddlePaddle的文档。
+
+
+使用Docker构建PaddlePaddle的文档
+--------------------------------
+
+使用Docker构建PaddlePaddle的文档,首先要求在系统里安装好Docker工具包。安装Docker请参考 `Docker的官网 `_ 。
+
+安装好Docker之后可以使用源码目录下的脚本构建文档,即
+
+.. code-block:: bash
+
+ cd TO_YOUR_PADDLE_CLONE_PATH
+ cd paddle/scripts/tools/build_docs
+ bash build_docs.sh
+
+执行完这个脚本后,该目录下会生成两个目录,分别是\:
+
+* doc 目录,英文文档地址
+* doc_cn 目录,中文文档地址
+
+打开浏览器访问对应目录下的index.html即可访问本地文档。
+
+.. code-block:: bash
+
+ open doc_cn/index.html
+
+
+直接构建PaddlePaddle的文档
+--------------------------
+
+TBD
+
+
+如何更新www.paddlepaddle.org文档
+================================
+
+TBD
+
+
+.. _cmake: https://cmake.org/
+.. _sphinx: http://www.sphinx-doc.org/en/1.4.8/
\ No newline at end of file
diff --git a/doc_cn/index.rst b/doc_cn/index.rst
index e74b0942a6cc08144368804aef515467f7291199..f1398206fddffca77f583c195e00034e55932639 100644
--- a/doc_cn/index.rst
+++ b/doc_cn/index.rst
@@ -15,6 +15,7 @@ PaddlePaddle文档
开发指南
--------
* `新写Layer <../doc/dev/new_layer/index.html>`_
+* `如何贡献文档 `_
算法教程
--------
diff --git a/paddle/gserver/layers/CudnnConvLayer.cpp b/paddle/gserver/layers/CudnnConvLayer.cpp
index e77216f17c3beded35a44d7a33ab3a2fc1678941..23ba2341185d1b86b90dee58939f8ca07fda9364 100644
--- a/paddle/gserver/layers/CudnnConvLayer.cpp
+++ b/paddle/gserver/layers/CudnnConvLayer.cpp
@@ -35,8 +35,8 @@ bool CudnnConvLayer::init(const LayerMap &layerMap,
ProjectionConfig* conf = new ProjectionConfig();
conf->set_type("conv");
conf->set_num_filters(numFilters_);
- conf->set_allocated_conv_conf(
- config_.mutable_inputs(i)->mutable_conv_conf());
+ ConvConfig* convConf = conf->mutable_conv_conf();
+ *convConf = *(config_.mutable_inputs(i)->mutable_conv_conf());
conf->set_input_size(getPrev(i)->getSize());
conf->set_output_size(getSize());
projConf_.emplace_back(conf);
diff --git a/paddle/scripts/tools/build_docs/.gitignore b/paddle/scripts/tools/build_docs/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..6ec14c8f5bc3774a81dbe87c44f458594b38f12c
--- /dev/null
+++ b/paddle/scripts/tools/build_docs/.gitignore
@@ -0,0 +1,2 @@
+doc
+doc_cn
diff --git a/paddle/scripts/tools/build_docs/Dockerfile b/paddle/scripts/tools/build_docs/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..5db0b29c4739943f9e677dc7973b392a345b7da1
--- /dev/null
+++ b/paddle/scripts/tools/build_docs/Dockerfile
@@ -0,0 +1,6 @@
+FROM paddledev/paddle:cpu-devel-latest
+COPY build.sh /
+RUN pip install sphinx &&\
+ apt install -y doxygen graphviz &&\
+ pip install breathe recommonmark numpy protobuf==2.6.1
+CMD /build.sh
diff --git a/paddle/scripts/tools/build_docs/build.sh b/paddle/scripts/tools/build_docs/build.sh
new file mode 100755
index 0000000000000000000000000000000000000000..a23b6e61d45926e77015365627bfb7dca303ac65
--- /dev/null
+++ b/paddle/scripts/tools/build_docs/build.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -ex
+
+mkdir -p /build
+cd /build
+cmake /paddle -DWITH_DOC=ON
+make paddle_docs paddle_docs_cn -j `nproc`
+mkdir -p /output/doc
+mkdir -p /output/doc_cn
+cp -r doc/html/* /output/doc/
+cp -r doc_cn/html/* /output/doc_cn/
+cd /
+rm -rf /paddle/build
diff --git a/paddle/scripts/tools/build_docs/build_docs.sh b/paddle/scripts/tools/build_docs/build_docs.sh
new file mode 100755
index 0000000000000000000000000000000000000000..9f8b80435c8fb17907d7da52c864a448f0d8d136
--- /dev/null
+++ b/paddle/scripts/tools/build_docs/build_docs.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -e
+docker build . -t paddle_build_doc
+docker run --rm -v $PWD/../../../../:/paddle -v $PWD:/output paddle_build_doc
diff --git a/paddle/trainer/Tester.cpp b/paddle/trainer/Tester.cpp
index b1bb75654a9d5d9ad02d66b662f431019b2d7f05..d3b88019faa04b7cebf44dd63678aa9d4ffb5252 100644
--- a/paddle/trainer/Tester.cpp
+++ b/paddle/trainer/Tester.cpp
@@ -116,6 +116,7 @@ void Tester::testOnePeriod() {
}
testOneDataBatch(dataBatch, &outArgs);
}
+ finishTestPeriod();
}
void Tester::finishTestPeriod() {
diff --git a/proto/ModelConfig.proto.m4 b/proto/ModelConfig.proto.m4
index b8047a3344d20f117966c043b2fe24d58db4f9b1..4ef1550105492f9a57f1db5c5f2035eb6daa6772 100644
--- a/proto/ModelConfig.proto.m4
+++ b/proto/ModelConfig.proto.m4
@@ -394,6 +394,15 @@ sinclude(`ModelConfigLayer.proto.m4')
// bias size
optional uint32 bias_size = 48 [default = 0];
+
+ // this parameter can be used as a user-defined parameter when necessary,
+ // without changing the proto file.
+ // e.g., when a new layer with a user-defined parameter is implemented,
+ // it can be used to pass that parameter, without modifying the proto file.
+ // string type is used for flexibility: different types can be converted
+ // to string and reinterpreted in the user's own layer implementation.
+ optional string user_arg = 49;
+
}
message EvaluatorConfig {