Add support for Conv1D on OpenCV backend#18783
Conversation
| typedef tuple<Conv1DParamID, tuple<Backend, Target> > Conv1DTestParam_t; | ||
| typedef TestBaseWithParam<Conv1DTestParam_t> Conv1D; | ||
|
|
||
| PERF_TEST_P_(Conv1D, conv1d) |
| Target targetId = get<1>(get<1>(GetParam())); | ||
|
|
||
| if (targetId != DNN_TARGET_CPU) | ||
| throw SkipTestException("Only CPU is supported"); |
There was a problem hiding this comment.
Indentation.
Sorry, my formatter broke (again)
| lp.set("kernel_size", kernel); | ||
| lp.set("pad", pad); | ||
| if (!padMode.empty()) | ||
| lp.set("pad_mode", padMode); |
| { | ||
| Mat bias(1, outChannels, CV_32F); | ||
| randu(bias, -1.0f, 1.0f); | ||
| lp.blobs.push_back(bias); | ||
| } |
| { | ||
| Mat res = net.forward(); | ||
| } | ||
| EXPECT_NEAR(flops, declared_flops, declared_flops * 1e-6); |
There was a problem hiding this comment.
flops is integer value. Check should be exact without epsilon.
| net.setPreferableBackend(backendId); | ||
| net.setPreferableTarget(targetId); | ||
|
|
||
| Mat output = net.forward(); |
There was a problem hiding this comment.
Please add some check for output result. At least output shape.
There was a problem hiding this comment.
Actually, this is a warmup iteration, I don't think it is necessary to check the correctness of output shapes inside performance tests (it is already covered in other tests)
c6ae9c1 to
453cf77
Compare
|
@dkurt I have updated the code, can you resolve your comments/requests? |
|
@asmorkalov Can you resolve your comments/requests? |
|
Ignore these test failures because they are not related to this patch. |
|
Could you please add test with variable weights ( |
Sure |
|
"Merge 3.4" is expected on this week (at 21:00 UTC today or tomorrow) |
|
You can skip implementation of OpenCL optimizations, but it should be properly handled. There is general policy about DNN layers implementation:
/cc @vpisarev |
You have used outdated versions of IE for testing. |
resolves #18205
merge with extra: opencv/opencv_extra#813