Merge pull request #19057 from sl-sergei:changes_for_cuda_1d

pull/19429/head
Alexander Alekhin 4 years ago
commit b9dfffc237
  1. 3
      modules/dnn/src/layers/convolution_layer.cpp
  2. 9
      modules/dnn/src/layers/pooling_layer.cpp

@ -117,6 +117,9 @@ public:
{ {
kernel_size.assign(1, kernel_size[0]); kernel_size.assign(1, kernel_size[0]);
strides.assign(1, strides[0]); strides.assign(1, strides[0]);
dilations.assign(1, dilations[0]);
pads_begin.assign(1, pads_begin[0]);
pads_end.assign(1, pads_end[0]);
} }
CV_Assert(weightShape.dims() == kernel_size.size() + 2); CV_Assert(weightShape.dims() == kernel_size.size() + 2);
for (int i = 0; i < kernel_size.size(); i++) { for (int i = 0; i < kernel_size.size(); i++) {

@ -168,13 +168,12 @@ public:
if (inputs[0].dims == 3) if (inputs[0].dims == 3)
{ {
// Pool1D // Pool1D
kernel_size.erase(kernel_size.begin() + 1); kernel_size.assign(1, kernel_size[0]);
strides.erase(strides.begin() + 1); strides.assign(1, strides[0]);
pads_begin.erase(pads_begin.begin() + 1); pads_begin.assign(1, pads_begin[0]);
pads_end.erase(pads_end.begin() + 1); pads_end.assign(1, pads_end[0]);
} }
#ifdef HAVE_OPENCL #ifdef HAVE_OPENCL
poolOp.release(); poolOp.release();
#endif #endif

Loading…
Cancel
Save