using namespace cv::dnn;
using namespace testing;
-static void test(Mat& input, Net& net, int backendId, int targetId)
+static void test(Mat& input, Net& net, Backend backendId, Target targetId)
{
DNNTestLayer::checkBackend(backendId, targetId);
randu(input, -1.0f, 1.0f);
normAssert(outputDefault, outputHalide, "", l1, lInf);
}
-static void test(LayerParams& params, Mat& input, int backendId, int targetId)
+static void test(LayerParams& params, Mat& input, Backend backendId, Target targetId)
{
Net net;
net.addLayerToPrev(params.name, params.type, params);
Size pad = get<4>(GetParam());
Size dilation = get<5>(GetParam());
bool hasBias = get<6>(GetParam());
- int backendId = get<0>(get<7>(GetParam()));
- int targetId = get<1>(get<7>(GetParam()));
+ Backend backendId = get<0>(get<7>(GetParam()));
+ Target targetId = get<1>(get<7>(GetParam()));
if (backendId == DNN_BACKEND_INFERENCE_ENGINE && targetId == DNN_TARGET_MYRIAD)
throw SkipTestException("");
Size stride = Size(get<5>(GetParam())[0], get<5>(GetParam())[1]);
Size adjPad = Size(get<5>(GetParam())[2], get<5>(GetParam())[3]);
bool hasBias = get<6>(GetParam());
- int backendId = get<0>(get<7>(GetParam()));
- int targetId = get<1>(get<7>(GetParam()));
+ Backend backendId = get<0>(get<7>(GetParam()));
+ Target targetId = get<1>(get<7>(GetParam()));
if (backendId == DNN_BACKEND_INFERENCE_ENGINE && targetId == DNN_TARGET_CPU &&
dilation.width == 2 && dilation.height == 2)
throw SkipTestException("");
float bias = get<2>(GetParam())[2];
bool normBySize = get<3>(GetParam());
std::string nrmType = get<4>(GetParam());
- int backendId = get<0>(get<5>(GetParam()));
- int targetId = get<1>(get<5>(GetParam()));
+ Backend backendId = get<0>(get<5>(GetParam()));
+ Target targetId = get<1>(get<5>(GetParam()));
if (backendId == DNN_BACKEND_INFERENCE_ENGINE)
throw SkipTestException("");
Size outSize = get<1>(GetParam());; // Input size will be computed from parameters.
Size kernel = get<2>(GetParam());
Size stride = get<3>(GetParam());
- int backendId = get<0>(get<4>(GetParam()));
- int targetId = get<1>(get<4>(GetParam()));
+ Backend backendId = get<0>(get<4>(GetParam()));
+ Target targetId = get<1>(get<4>(GetParam()));
if (backendId == DNN_BACKEND_INFERENCE_ENGINE && targetId == DNN_TARGET_MYRIAD)
throw SkipTestException("");
Size kernel = get<2>(GetParam());
Size stride = get<3>(GetParam());
Size pad = get<4>(GetParam());
- int backendId = get<0>(get<5>(GetParam()));
- int targetId = get<1>(get<5>(GetParam()));
+ Backend backendId = get<0>(get<5>(GetParam()));
+ Target targetId = get<1>(get<5>(GetParam()));
LayerParams lp;
lp.set("pool", "max");
Size inSize = get<1>(GetParam());
int outChannels = get<2>(GetParam());
bool hasBias = get<3>(GetParam());
- int backendId = get<0>(get<4>(GetParam()));
- int targetId = get<1>(get<4>(GetParam()));
+ Backend backendId = get<0>(get<4>(GetParam()));
+ Target targetId = get<1>(get<4>(GetParam()));
if (backendId == DNN_BACKEND_INFERENCE_ENGINE)
throw SkipTestException("");
TEST_P(SoftMax, Accuracy)
{
int inChannels = get<0>(GetParam());
- int backendId = get<0>(get<1>(GetParam()));
- int targetId = get<1>(get<1>(GetParam()));
+ Backend backendId = get<0>(get<1>(GetParam()));
+ Target targetId = get<1>(get<1>(GetParam()));
LayerParams lp;
lp.type = "SoftMax";
lp.name = "testLayer";
////////////////////////////////////////////////////////////////////////////////
static const int kNumChannels = 3;
-void testInPlaceActivation(LayerParams& lp, int backendId, int targetId)
+void testInPlaceActivation(LayerParams& lp, Backend backendId, Target targetId)
{
EXPECT_FALSE(lp.name.empty());
bool hasWeights = get<0>(GetParam());
bool hasBias = get<1>(GetParam());
float epsilon = get<2>(GetParam());
- int backendId = get<0>(get<3>(GetParam()));
- int targetId = get<1>(get<3>(GetParam()));
+ Backend backendId = get<0>(get<3>(GetParam()));
+ Target targetId = get<1>(get<3>(GetParam()));
LayerParams lp;
lp.set("has_weight", hasWeights);
TEST_P(ReLU, Accuracy)
{
float negativeSlope = get<0>(GetParam());
- int backendId = get<0>(get<1>(GetParam()));
- int targetId = get<1>(get<1>(GetParam()));
+ Backend backendId = get<0>(get<1>(GetParam()));
+ Target targetId = get<1>(get<1>(GetParam()));
LayerParams lp;
lp.set("negative_slope", negativeSlope);
typedef TestWithParam<tuple<std::string, tuple<Backend, Target> > > NoParamActivation;
TEST_P(NoParamActivation, Accuracy)
{
- int backendId = get<0>(get<1>(GetParam()));
- int targetId = get<1>(get<1>(GetParam()));
+ Backend backendId = get<0>(get<1>(GetParam()));
+ Target targetId = get<1>(get<1>(GetParam()));
LayerParams lp;
lp.type = get<0>(GetParam());
float power = get<0>(GetParam())[0];
float scale = get<0>(GetParam())[1];
float shift = get<0>(GetParam())[2];
- int backendId = get<0>(get<1>(GetParam()));
- int targetId = get<1>(get<1>(GetParam()));
+ Backend backendId = get<0>(get<1>(GetParam()));
+ Target targetId = get<1>(get<1>(GetParam()));
LayerParams lp;
lp.set("power", power);
TEST_P(Scale, Accuracy)
{
bool hasBias = get<0>(GetParam());
- int backendId = get<0>(get<1>(GetParam()));
- int targetId = get<1>(get<1>(GetParam()));
+ Backend backendId = get<0>(get<1>(GetParam()));
+ Target targetId = get<1>(get<1>(GetParam()));
LayerParams lp;
lp.set("bias_term", hasBias);
{
Vec3i inSize = get<0>(GetParam());
Vec3i numChannels = get<1>(GetParam());
- int backendId = get<0>(get<2>(GetParam()));
- int targetId = get<1>(get<2>(GetParam()));
+ Backend backendId = get<0>(get<2>(GetParam()));
+ Target targetId = get<1>(get<2>(GetParam()));
Net net;
std::string op = get<1>(GetParam());
int numConv = get<2>(GetParam());
bool weighted = get<3>(GetParam());
- int backendId = get<0>(get<4>(GetParam()));
- int targetId = get<1>(get<4>(GetParam()));
+ Backend backendId = get<0>(get<4>(GetParam()));
+ Target targetId = get<1>(get<4>(GetParam()));
Net net;