diff --git a/doc/getstarted/build_and_install/docker_install_cn.rst b/doc/getstarted/build_and_install/docker_install_cn.rst index bae42593ddc6f7a7eb47d603752ad6efa9820b45..98fada7bdb46f4dd2927d6f93bcbcebbe7d18604 100644 --- a/doc/getstarted/build_and_install/docker_install_cn.rst +++ b/doc/getstarted/build_and_install/docker_install_cn.rst @@ -25,14 +25,14 @@ .. code-block:: bash - docker pull docker.paddlepaddle.org/paddle + docker pull docker.paddlepaddlehub.com/paddle 下载GPU版本(cuda8.0_cudnn5_avx_mkl)的Docker镜像: .. code-block:: bash docker pull paddlepaddle/paddle:latest-gpu - docker pull docker.paddlepaddle.org/paddle:latest-gpu + docker pull docker.paddlepaddlehub.com/paddle:latest-gpu 选择下载使用不同的BLAS库的Docker镜像: @@ -49,7 +49,7 @@ docker pull paddlepaddle/paddle:[tag] # 比如: - docker pull docker.paddlepaddle.org/paddle:0.10.0-gpu + docker pull docker.paddlepaddlehub.com/paddle:0.11.0-gpu .. _docker_run: diff --git a/doc/getstarted/build_and_install/docker_install_en.rst b/doc/getstarted/build_and_install/docker_install_en.rst index 56a7c68e4d39c45249fa55a964dc48b7081596a6..b1d0890b4cdddb77114a80276130afd07c22d270 100644 --- a/doc/getstarted/build_and_install/docker_install_en.rst +++ b/doc/getstarted/build_and_install/docker_install_en.rst @@ -26,14 +26,14 @@ For users in China, we provide a faster mirror: .. code-block:: bash - docker pull docker.paddlepaddle.org/paddle + docker pull docker.paddlepaddlehub.com/paddle Download GPU version (cuda8.0_cudnn5_avx_mkl) images: .. code-block:: bash docker pull paddlepaddle/paddle:latest-gpu - docker pull docker.paddlepaddle.org/paddle:latest-gpu + docker pull docker.paddlepaddlehub.com/paddle:latest-gpu Choose between different BLAS version: @@ -53,7 +53,7 @@ and run: docker pull paddlepaddle/paddle:[tag] # i.e. - docker pull docker.paddlepaddle.org/paddle:0.10.0-gpu + docker pull docker.paddlepaddlehub.com/paddle:0.11.0-gpu .. _docker_run: diff --git a/paddle/framework/variable_test.cc b/paddle/framework/variable_test.cc index e4732d9718e2b46a068963d44c4c1e04024f2330..e5585c8724d712e273d086001b6cbc3d59c46ebe 100644 --- a/paddle/framework/variable_test.cc +++ b/paddle/framework/variable_test.cc @@ -12,19 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -/* - Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - #include #include diff --git a/paddle/operators/bipartite_match_op.cc b/paddle/operators/bipartite_match_op.cc index b0f7376d272a66e0b01d6b3f7e546372397772f7..83c8778fe4cec4d9d80de691e117a39fdd92f494 100644 --- a/paddle/operators/bipartite_match_op.cc +++ b/paddle/operators/bipartite_match_op.cc @@ -21,8 +21,6 @@ namespace operators { using Tensor = framework::Tensor; using LoDTensor = framework::LoDTensor; -constexpr char kEPS = 1e-6; - class BipartiteMatchOp : public framework::OperatorWithKernel { public: using framework::OperatorWithKernel::OperatorWithKernel; @@ -46,6 +44,7 @@ class BipartiteMatchKernel : public framework::OpKernel { // The match_dist must be initialized to 0 at first. void BipartiteMatch(const Tensor& dist, int* match_indices, T* match_dist) const { + constexpr T kEPS = static_cast(1e-6); PADDLE_ENFORCE_EQ(dist.dims().size(), 2, "The rank of dist must be 2."); int64_t row = dist.dims()[0]; int64_t col = dist.dims()[1]; diff --git a/python/paddle/v2/dataset/wmt16.py b/python/paddle/v2/dataset/wmt16.py index e2f463be2f7bcd667855f64206d78f387e92ef33..c8818f715beadd9499ae588f2c19a57fbf26f372 100644 --- a/python/paddle/v2/dataset/wmt16.py +++ b/python/paddle/v2/dataset/wmt16.py @@ -305,9 +305,9 @@ def get_dict(lang, dict_size, reverse=False): dict_path = os.path.join(paddle.v2.dataset.common.DATA_HOME, "wmt16/%s_%d.dict" % (lang, dict_size)) - assert (os.path.exists(dict_path), "Word dictionary does not exist. " - "Please invoke paddle.dataset.wmt16.train/test/validation " - "first to build the dictionary.") + assert os.path.exists(dict_path), "Word dictionary does not exist. " + "Please invoke paddle.dataset.wmt16.train/test/validation first " + "to build the dictionary." tar_file = os.path.join(paddle.v2.dataset.common.DATA_HOME, "wmt16.tar.gz") return __load_dict(tar_file, dict_size, lang, reverse) diff --git a/python/paddle/v2/fluid/tests/test_bipartite_match_op.py b/python/paddle/v2/fluid/tests/test_bipartite_match_op.py index 34101b1da46d46d0e7a995ba80d8644dc586065d..74138298978c7c18936f53761b313887f07aea81 100644 --- a/python/paddle/v2/fluid/tests/test_bipartite_match_op.py +++ b/python/paddle/v2/fluid/tests/test_bipartite_match_op.py @@ -16,13 +16,13 @@ import numpy as np from op_test import OpTest -def bipartite_match(distance, match_indices, match_dis): +def bipartite_match(distance, match_indices, match_dist): """Bipartite Matching algorithm. Arg: distance (numpy.array) : The distance of two entries with shape [M, N]. match_indices (numpy.array): the matched indices from column to row with shape [1, N], it must be initialized to -1. - match_dis (numpy.array): The matched distance from column to row + match_dist (numpy.array): The matched distance from column to row with shape [1, N], it must be initialized to 0. """ match_pair = [] @@ -36,13 +36,13 @@ def bipartite_match(distance, match_indices, match_dis): row_indices = -1 * np.ones((row, ), dtype=np.int) idx = 0 - for i, j, dis in match_sorted: + for i, j, dist in match_sorted: if idx >= row: break - if match_indices[j] == -1 and row_indices[i] == -1 and dis > 0: + if match_indices[j] == -1 and row_indices[i] == -1 and dist > 0: match_indices[j] = i row_indices[i] = j - match_dis[j] = dis + match_dist[j] = dist idx += 1 @@ -55,24 +55,24 @@ def batch_bipartite_match(distance, lod): n = len(lod) - 1 m = distance.shape[1] match_indices = -1 * np.ones((n, m), dtype=np.int) - match_dis = np.zeros((n, m), dtype=np.float32) + match_dist = np.zeros((n, m), dtype=np.float32) for i in range(len(lod) - 1): bipartite_match(distance[lod[i]:lod[i + 1], :], match_indices[i, :], - match_dis[i, :]) - return match_indices, match_dis + match_dist[i, :]) + return match_indices, match_dist class TestBipartiteMatchOpForWithLoD(OpTest): def setUp(self): self.op_type = 'bipartite_match' lod = [[0, 5, 11, 23]] - dis = np.random.random((23, 217)).astype('float32') - match_indices, match_dis = batch_bipartite_match(dis, lod[0]) + dist = np.random.random((23, 217)).astype('float32') + match_indices, match_dist = batch_bipartite_match(dist, lod[0]) - self.inputs = {'DistMat': (dis, lod)} + self.inputs = {'DistMat': (dist, lod)} self.outputs = { 'ColToRowMatchIndices': (match_indices), - 'ColToRowMatchDis': (match_dis), + 'ColToRowMatchDis': (match_dist), } def test_check_output(self): @@ -83,13 +83,13 @@ class TestBipartiteMatchOpWithoutLoD(OpTest): def setUp(self): self.op_type = 'bipartite_match' lod = [[0, 8]] - dis = np.random.random((8, 17)).astype('float32') - match_indices, match_dis = batch_bipartite_match(dis, lod[0]) + dist = np.random.random((8, 17)).astype('float32') + match_indices, match_dist = batch_bipartite_match(dist, lod[0]) - self.inputs = {'DistMat': dis} + self.inputs = {'DistMat': dist} self.outputs = { - 'ColToRowMatchIndices': (match_indices), - 'ColToRowMatchDis': (match_dis), + 'ColToRowMatchIndices': match_indices, + 'ColToRowMatchDis': match_dist, } def test_check_output(self):