diff --git a/modules/dnn/src/torch/torch_importer.cpp b/modules/dnn/src/torch/torch_importer.cpp index 7e387929ce..bfd01a0bb3 100644 --- a/modules/dnn/src/torch/torch_importer.cpp +++ b/modules/dnn/src/torch/torch_importer.cpp @@ -598,7 +598,7 @@ struct TorchImporter readTorchTable(scalarParams, tensorParams); CV_Assert(tensorParams.count("weight")); - Mat weightBlob = tensorParams["weight"].second; + const Mat& weightBlob = tensorParams["weight"].second; layerParams.blobs.push_back(weightBlob); bool bias = tensorParams.count("bias") != 0;