Commit 5e082ab8 authored by YashasSamaga's avatar YashasSamaga

resize tensor on reuse if required

parent 8eafddf2
...@@ -305,6 +305,10 @@ namespace cv { namespace dnn { ...@@ -305,6 +305,10 @@ namespace cv { namespace dnn {
shape = shape_; shape = shape_;
offset = 0; offset = 0;
shared_block = base->shared_block; shared_block = base->shared_block;
auto numel = total(shape_);
if (numel > shared_block->device.size())
shared_block->device.reset(numel);
} }
static Ptr<BackendWrapper> create(Mat& m) { static Ptr<BackendWrapper> create(Mat& m) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment