1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Refactored Padding layer

This commit is contained in:
Dmitry Kurtaev
2017-09-22 12:12:03 +03:00
parent a0d3d11470
commit 222149b9c6
7 changed files with 168 additions and 115 deletions
+22
View File
@@ -34,6 +34,28 @@ static void test(LayerParams& params, Mat& input)
normAssert(outputDefault, outputHalide);
}
////////////////////////////////////////////////////////////////////////////////
// Padding
////////////////////////////////////////////////////////////////////////////////
TEST(Padding_Halide, Accuracy)
{
static const int kNumRuns = 10;
std::vector<int> paddings(8);
for (int t = 0; t < kNumRuns; ++t)
{
for (int i = 0; i < paddings.size(); ++i)
paddings[i] = rand() % 5;
LayerParams lp;
lp.set("paddings", DictValue::arrayInt<int*>(&paddings[0], paddings.size()));
lp.type = "Padding";
lp.name = "testLayer";
Mat input({1 + rand() % 10, 1 + rand() % 10, 1 + rand() % 10, 1 + rand() % 10}, CV_32F);
test(lp, input);
}
}
////////////////////////////////////////////////////////////////////////////////
// Convolution
////////////////////////////////////////////////////////////////////////////////