Skip to content

Commit 1ee3086

Browse files
committed
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into block_expand_py
2 parents fdc59ae + b455502 commit 1ee3086

File tree

12 files changed

+246
-117
lines changed

12 files changed

+246
-117
lines changed

doc/getstarted/build_and_install/docker_install_cn.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525

2626
.. code-block:: bash
2727
28-
docker pull docker.paddlepaddle.org/paddle
28+
docker pull docker.paddlepaddlehub.com/paddle
2929
3030
下载GPU版本(cuda8.0_cudnn5_avx_mkl)的Docker镜像:
3131

3232
.. code-block:: bash
3333
3434
docker pull paddlepaddle/paddle:latest-gpu
35-
docker pull docker.paddlepaddle.org/paddle:latest-gpu
35+
docker pull docker.paddlepaddlehub.com/paddle:latest-gpu
3636
3737
选择下载使用不同的BLAS库的Docker镜像:
3838

@@ -49,7 +49,7 @@
4949
5050
docker pull paddlepaddle/paddle:[tag]
5151
# 比如:
52-
docker pull docker.paddlepaddle.org/paddle:0.10.0-gpu
52+
docker pull docker.paddlepaddlehub.com/paddle:0.11.0-gpu
5353
5454
.. _docker_run:
5555

doc/getstarted/build_and_install/docker_install_en.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ For users in China, we provide a faster mirror:
2626

2727
.. code-block:: bash
2828
29-
docker pull docker.paddlepaddle.org/paddle
29+
docker pull docker.paddlepaddlehub.com/paddle
3030
3131
Download GPU version (cuda8.0_cudnn5_avx_mkl) images:
3232

3333
.. code-block:: bash
3434
3535
docker pull paddlepaddle/paddle:latest-gpu
36-
docker pull docker.paddlepaddle.org/paddle:latest-gpu
36+
docker pull docker.paddlepaddlehub.com/paddle:latest-gpu
3737
3838
Choose between different BLAS version:
3939

@@ -53,7 +53,7 @@ and run:
5353
5454
docker pull paddlepaddle/paddle:[tag]
5555
# i.e.
56-
docker pull docker.paddlepaddle.org/paddle:0.10.0-gpu
56+
docker pull docker.paddlepaddlehub.com/paddle:0.11.0-gpu
5757
5858
.. _docker_run:
5959

paddle/framework/variable_test.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
/*
16-
Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
17-
Licensed under the Apache License, Version 2.0 (the "License");
18-
you may not use this file except in compliance with the License.
19-
You may obtain a copy of the License at
20-
http://www.apache.org/licenses/LICENSE-2.0
21-
Unless required by applicable law or agreed to in writing, software
22-
distributed under the License is distributed on an "AS IS" BASIS,
23-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24-
See the License for the specific language governing permissions and
25-
limitations under the License.
26-
*/
27-
2815
#include <memory>
2916
#include <string>
3017

paddle/operators/bipartite_match_op.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ namespace operators {
2121
using Tensor = framework::Tensor;
2222
using LoDTensor = framework::LoDTensor;
2323

24-
constexpr char kEPS = 1e-6;
25-
2624
class BipartiteMatchOp : public framework::OperatorWithKernel {
2725
public:
2826
using framework::OperatorWithKernel::OperatorWithKernel;
@@ -46,6 +44,7 @@ class BipartiteMatchKernel : public framework::OpKernel<T> {
4644
// The match_dist must be initialized to 0 at first.
4745
void BipartiteMatch(const Tensor& dist, int* match_indices,
4846
T* match_dist) const {
47+
constexpr T kEPS = static_cast<T>(1e-6);
4948
PADDLE_ENFORCE_EQ(dist.dims().size(), 2, "The rank of dist must be 2.");
5049
int64_t row = dist.dims()[0];
5150
int64_t col = dist.dims()[1];

paddle/operators/conv_transpose_op.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ The input(X) size and output(Out) size may be different.
160160
Output shape: $(N, C_{out}, H_{out}, W_{out})$
161161
Where
162162
$$
163-
H_{out} = (H_{in} - 1) * strides[0] - 2 * paddings[0] + H_f \\
164-
W_{out} = (W_{in} - 1) * strides[1] - 2 * paddings[1] + W_f
163+
H_{out} = (H_{in} - 1) * strides[0] - 2 * paddings[0] + dilations[0] * (H_f - 1) + 1 \\
164+
W_{out} = (W_{in} - 1) * strides[1] - 2 * paddings[1] + dilations[1] * (W_f - 1) + 1
165165
$$
166166
)DOC");
167167
}
@@ -249,9 +249,9 @@ The input(X) size and output(Out) size may be different.
249249
Output shape: $(N, C_{out}, D_{out}, H_{out}, W_{out})$
250250
Where
251251
$$
252-
D_{out} = (D_{in} - 1) * strides[0] - 2 * paddings[0] + D_f \\
253-
H_{out} = (H_{in} - 1) * strides[1] - 2 * paddings[1] + H_f \\
254-
W_{out} = (W_{in} - 1) * strides[2] - 2 * paddings[2] + W_f
252+
D_{out} = (D_{in} - 1) * strides[0] - 2 * paddings[0] + dilations[0] * (D_f - 1) + 1 \\
253+
H_{out} = (H_{in} - 1) * strides[1] - 2 * paddings[1] + dilations[1] * (H_f - 1) + 1 \\
254+
W_{out} = (W_{in} - 1) * strides[2] - 2 * paddings[2] + dilations[2] * (W_f - 1) + 1
255255
$$
256256
)DOC");
257257
}

paddle/operators/conv_transpose_op.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ class GemmConvTransposeKernel : public framework::OpKernel<T> {
141141
if (data_dim == 2U) {
142142
// col2im: col_matrix -> dy
143143
// from (c * k_h * k_w, h * w) to (c, o_h, o_w)
144-
col2im(dev_ctx, col, std::vector<int>{dilations[0], dilations[1]},
145-
strides, std::vector<int>{paddings[0], paddings[1], paddings[0],
146-
paddings[1]},
144+
col2im(dev_ctx, col, dilations, strides,
145+
std::vector<int>{paddings[0], paddings[1], paddings[0],
146+
paddings[1]},
147147
&output_batch);
148148
} else if (data_dim == 3U) {
149149
// col2vol: col_matrix -> dy
@@ -247,8 +247,7 @@ class GemmConvTransposeGradKernel : public framework::OpKernel<T> {
247247
if (data_dim == 2U) {
248248
// im2col: dy -> col matrix
249249
// from (c, o_h, o_w) to (c * k_h * k_w, h * w)
250-
im2col(dev_ctx, output_grad_batch,
251-
std::vector<int>{dilations[0], dilations[1]}, strides,
250+
im2col(dev_ctx, output_grad_batch, dilations, strides,
252251
std::vector<int>{paddings[0], paddings[1], paddings[0],
253252
paddings[1]},
254253
&col);

paddle/operators/nce_op.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ class NCEOpMaker : public framework::OpProtoAndCheckerMaker {
124124
"This attribute only be used in unitest. Classes "
125125
"in this list wiil be used as negative classes "
126126
"for every samples. Under normal conditions, "
127-
"user should avoid setting this attribute.");
127+
"user should avoid setting this attribute.")
128+
.SetDefault({});
128129
AddComment(R"DOC(
129130
Compute and return the noise-contrastive estimation training loss.
130131
See [Noise-contrastive estimation: A new estimation principle for unnormalized statistical models](http://www.jmlr.org/proceedings/papers/v9/gutmann10a/gutmann10a.pdf).

paddle/operators/nce_op.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ class NCEGradKernel : public framework::OpKernel<T> {
197197
// get d_x
198198
auto d_x = context.Output<Tensor>(framework::GradVarName("Input"));
199199
if (d_x != nullptr) {
200-
d_x->mutable_data<T>(context.GetPlace());
200+
auto* d_x_data = d_x->mutable_data<T>(context.GetPlace());
201+
std::fill(d_x_data, d_x_data + d_x->numel(), 0.0);
201202
auto d_x_matrix = EigenMatrix<T>::From(*d_x);
202203
auto w_matrix = EigenMatrix<T>::From(*(context.Input<Tensor>("Weight")));
203204
for (int64_t i = 0; i < sample_labels->numel(); ++i) {

python/paddle/v2/dataset/wmt16.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ def get_dict(lang, dict_size, reverse=False):
305305

306306
dict_path = os.path.join(paddle.v2.dataset.common.DATA_HOME,
307307
"wmt16/%s_%d.dict" % (lang, dict_size))
308-
assert (os.path.exists(dict_path), "Word dictionary does not exist. "
309-
"Please invoke paddle.dataset.wmt16.train/test/validation "
310-
"first to build the dictionary.")
308+
assert os.path.exists(dict_path), "Word dictionary does not exist. "
309+
"Please invoke paddle.dataset.wmt16.train/test/validation first "
310+
"to build the dictionary."
311311
tar_file = os.path.join(paddle.v2.dataset.common.DATA_HOME, "wmt16.tar.gz")
312312
return __load_dict(tar_file, dict_size, lang, reverse)
313313

0 commit comments

Comments
 (0)