Skip to content

Commit 35e61b3

Browse files
committed
Merge branch 'develop' of https://github.com/paddlepaddle/paddle into move_to_fluid
2 parents 1226665 + 74492d5 commit 35e61b3

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

paddle/fluid/inference/tests/book/test_helper.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ template <typename T>
3434
void SetupTensor(paddle::framework::LoDTensor& input,
3535
paddle::framework::DDim dims,
3636
std::vector<T>& data) {
37-
CHECK_EQ(paddle::framework::product(dims), data.size());
37+
CHECK_EQ(paddle::framework::product(dims), static_cast<int64_t>(data.size()));
3838
T* input_ptr = input.mutable_data<T>(dims, paddle::platform::CPUPlace());
3939
memcpy(input_ptr, data.data(), input.numel() * sizeof(T));
4040
}
@@ -55,7 +55,7 @@ void SetupLoDTensor(paddle::framework::LoDTensor& input,
5555
paddle::framework::LoD lod,
5656
std::vector<T>& data) {
5757
const size_t level = lod.size() - 1;
58-
CHECK_EQ(dims[0], (lod[level]).back());
58+
CHECK_EQ(dims[0], static_cast<int64_t>((lod[level]).back()));
5959
input.set_lod(lod);
6060
SetupTensor<T>(input, dims, data);
6161
}
@@ -84,7 +84,7 @@ void CheckError(paddle::framework::LoDTensor& output1,
8484
count++;
8585
}
8686
}
87-
EXPECT_EQ(count, 0) << "There are " << count << " different elements.";
87+
EXPECT_EQ(count, 0U) << "There are " << count << " different elements.";
8888
}
8989

9090
template <typename Place, bool IsCombined = false>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import unittest
16+
import paddle.v2.fluid as fluid
17+
18+
19+
class TestCSPFramework(unittest.TestCase):
20+
def daisy_chain(self):
21+
n = 10000
22+
leftmost = fluid.make_channel(dtype=int)
23+
right = leftmost
24+
left = leftmost
25+
with fluid.While(steps=n):
26+
right = fluid.make_channel(dtype=int)
27+
with fluid.go():
28+
fluid.send(left, 1 + fluid.recv(right))
29+
left = right
30+
31+
with fluid.go():
32+
fluid.send(right, 1)
33+
fluid.Print(fluid.recv(leftmost))
34+
35+
36+
if __name__ == '__main__':
37+
unittest.main()

0 commit comments

Comments
 (0)