提交 35bbb4fb 编写于 作者: P Peng Li

change float to real in two test

Change float in test_ConvTrans and test_ConvUnify to real.
上级 2965df51
...@@ -206,8 +206,8 @@ TEST(Layer, convTransLayerFwd2) { ...@@ -206,8 +206,8 @@ TEST(Layer, convTransLayerFwd2) {
/* filter_size */ 5, /* filter_size */ 5,
result); result);
float resultData[] = {1, 2, 2, 2, 1, 2, 4, 4, 4, 2, 2, 4, 4, real resultData[] = {1, 2, 2, 2, 1, 2, 4, 4, 4, 2, 2, 4, 4,
4, 2, 2, 4, 4, 4, 2, 1, 2, 2, 2, 1}; 4, 2, 2, 4, 4, 4, 2, 1, 2, 2, 2, 1};
result->setData(resultData); result->setData(resultData);
doOneConvtTest(/* imgSize */ 5, doOneConvtTest(/* imgSize */ 5,
/* output_x */ 2, /* output_x */ 2,
...@@ -216,8 +216,8 @@ TEST(Layer, convTransLayerFwd2) { ...@@ -216,8 +216,8 @@ TEST(Layer, convTransLayerFwd2) {
/* filter_size */ 4, /* filter_size */ 4,
result); result);
float resultData2[] = {1, 2, 2, 2, 1, 2, 4, 4, 4, 2, 2, 4, 4, real resultData2[] = {1, 2, 2, 2, 1, 2, 4, 4, 4, 2, 2, 4, 4,
4, 2, 2, 4, 4, 4, 2, 1, 2, 2, 2, 1}; 4, 2, 2, 4, 4, 4, 2, 1, 2, 2, 2, 1};
result->setData(resultData2); result->setData(resultData2);
doOneConvtTest(/* imgSize */ 5, doOneConvtTest(/* imgSize */ 5,
/* output_x */ 2, /* output_x */ 2,
...@@ -226,8 +226,8 @@ TEST(Layer, convTransLayerFwd2) { ...@@ -226,8 +226,8 @@ TEST(Layer, convTransLayerFwd2) {
/* filter_size */ 5, /* filter_size */ 5,
result); result);
float resultData3[] = {1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 4, real resultData3[] = {1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 4,
2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1}; 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1};
result->setData(resultData3); result->setData(resultData3);
doOneConvtTest(/* imgSize */ 5, doOneConvtTest(/* imgSize */ 5,
/* output_x */ 2, /* output_x */ 2,
......
...@@ -106,8 +106,8 @@ TEST(Layer, convParaUnified) { ...@@ -106,8 +106,8 @@ TEST(Layer, convParaUnified) {
#ifndef PADDLE_ONLY_CPU #ifndef PADDLE_ONLY_CPU
MatrixPtr input, resultCpu, resultGpu; MatrixPtr input, resultCpu, resultGpu;
input = Matrix::create(1, 4 * 4, false, false); input = Matrix::create(1, 4 * 4, false, false);
float inputData[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; real inputData[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
float param[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1}; real param[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1};
input->setData(inputData); input->setData(inputData);
...@@ -137,26 +137,26 @@ TEST(Layer, convParaUnified) { ...@@ -137,26 +137,26 @@ TEST(Layer, convParaUnified) {
checkMatrixEqual(resultCpu, resultGpu); checkMatrixEqual(resultCpu, resultGpu);
input = Matrix::create(1, 3 * 3 * 2, false, false); input = Matrix::create(1, 3 * 3 * 2, false, false);
float inputData2[] = {1, real inputData2[] = {1,
2, 2,
3, 3,
4, 4,
5, 5,
6, 6,
7, 7,
8, 8,
9, 9,
10, 10,
11, 11,
12, 12,
13, 13,
14, 14,
15, 15,
16, 16,
17, 17,
18}; 18};
float param2[] = {1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}; real param2[] = {1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1};
input->setData(inputData2); input->setData(inputData2);
...@@ -185,7 +185,7 @@ TEST(Layer, convParaUnified) { ...@@ -185,7 +185,7 @@ TEST(Layer, convParaUnified) {
true); true);
checkMatrixEqual(resultCpu, resultGpu); checkMatrixEqual(resultCpu, resultGpu);
float param3[] = {1, 2, 3, 4, 4, 3, 2, 1}; real param3[] = {1, 2, 3, 4, 4, 3, 2, 1};
resultCpu = doOneConvTest(/* imgSize */ 3, resultCpu = doOneConvTest(/* imgSize */ 3,
/* output_x */ 2, /* output_x */ 2,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册