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:
@@ -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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user