Skip to content

Commit 35bbb4f

Browse files
author
Peng Li
committed
change float to real in two test
Change float in test_ConvTrans and test_ConvUnify to real.
1 parent 2965df5 commit 35bbb4f

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

paddle/gserver/tests/test_ConvTrans.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ TEST(Layer, convTransLayerFwd2) {
206206
/* filter_size */ 5,
207207
result);
208208

209-
float resultData[] = {1, 2, 2, 2, 1, 2, 4, 4, 4, 2, 2, 4, 4,
210-
4, 2, 2, 4, 4, 4, 2, 1, 2, 2, 2, 1};
209+
real resultData[] = {1, 2, 2, 2, 1, 2, 4, 4, 4, 2, 2, 4, 4,
210+
4, 2, 2, 4, 4, 4, 2, 1, 2, 2, 2, 1};
211211
result->setData(resultData);
212212
doOneConvtTest(/* imgSize */ 5,
213213
/* output_x */ 2,
@@ -216,8 +216,8 @@ TEST(Layer, convTransLayerFwd2) {
216216
/* filter_size */ 4,
217217
result);
218218

219-
float resultData2[] = {1, 2, 2, 2, 1, 2, 4, 4, 4, 2, 2, 4, 4,
220-
4, 2, 2, 4, 4, 4, 2, 1, 2, 2, 2, 1};
219+
real resultData2[] = {1, 2, 2, 2, 1, 2, 4, 4, 4, 2, 2, 4, 4,
220+
4, 2, 2, 4, 4, 4, 2, 1, 2, 2, 2, 1};
221221
result->setData(resultData2);
222222
doOneConvtTest(/* imgSize */ 5,
223223
/* output_x */ 2,
@@ -226,8 +226,8 @@ TEST(Layer, convTransLayerFwd2) {
226226
/* filter_size */ 5,
227227
result);
228228

229-
float resultData3[] = {1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 4,
230-
2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1};
229+
real resultData3[] = {1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 4,
230+
2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1};
231231
result->setData(resultData3);
232232
doOneConvtTest(/* imgSize */ 5,
233233
/* output_x */ 2,

paddle/gserver/tests/test_ConvUnify.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ TEST(Layer, convParaUnified) {
106106
#ifndef PADDLE_ONLY_CPU
107107
MatrixPtr input, resultCpu, resultGpu;
108108
input = Matrix::create(1, 4 * 4, false, false);
109-
float inputData[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
110-
float param[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1};
109+
real inputData[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
110+
real param[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1};
111111

112112
input->setData(inputData);
113113

@@ -137,26 +137,26 @@ TEST(Layer, convParaUnified) {
137137
checkMatrixEqual(resultCpu, resultGpu);
138138

139139
input = Matrix::create(1, 3 * 3 * 2, false, false);
140-
float inputData2[] = {1,
141-
2,
142-
3,
143-
4,
144-
5,
145-
6,
146-
7,
147-
8,
148-
9,
149-
150-
10,
151-
11,
152-
12,
153-
13,
154-
14,
155-
15,
156-
16,
157-
17,
158-
18};
159-
float param2[] = {1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1};
140+
real inputData2[] = {1,
141+
2,
142+
3,
143+
4,
144+
5,
145+
6,
146+
7,
147+
8,
148+
9,
149+
150+
10,
151+
11,
152+
12,
153+
13,
154+
14,
155+
15,
156+
16,
157+
17,
158+
18};
159+
real param2[] = {1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1};
160160

161161
input->setData(inputData2);
162162

@@ -185,7 +185,7 @@ TEST(Layer, convParaUnified) {
185185
true);
186186
checkMatrixEqual(resultCpu, resultGpu);
187187

188-
float param3[] = {1, 2, 3, 4, 4, 3, 2, 1};
188+
real param3[] = {1, 2, 3, 4, 4, 3, 2, 1};
189189

190190
resultCpu = doOneConvTest(/* imgSize */ 3,
191191
/* output_x */ 2,

0 commit comments

Comments
 (0)