From fd634e9a58210fe2da03d0b507010b86bf98e1ee Mon Sep 17 00:00:00 2001 From: Xu Yang Date: Thu, 25 Feb 2021 19:05:17 +0800 Subject: [PATCH] remove unnecessary mat clone when NCNN_BENCHMARK enabled (#2708) --- src/net.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index ae8853da3..6bc868de1 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -329,7 +329,7 @@ int NetPrivate::forward_layer(int layer_index, std::vector& blob_mats, cons if (layer->one_blob_only) { int bottom_blob_index = layer->bottoms[0]; - bottom_blob = blob_mats[bottom_blob_index]; + bottom_blob = blob_mats[bottom_blob_index].shape(); } #endif int ret = do_forward_layer(layer, blob_mats, opt); @@ -499,7 +499,7 @@ int NetPrivate::forward_layer(int layer_index, std::vector& blob_mats, std: if (layer->one_blob_only) { int bottom_blob_index = layer->bottoms[0]; - bottom_blob = blob_mats[bottom_blob_index]; + bottom_blob = blob_mats[bottom_blob_index].shape(); } #endif ret = do_forward_layer(layer, blob_mats, opt); @@ -830,7 +830,7 @@ IMAGE_ALLOCATION_FAILED: if (layer->one_blob_only) { int bottom_blob_index = layer->bottoms[0]; - bottom_blob = blob_mats[bottom_blob_index]; + bottom_blob = blob_mats[bottom_blob_index].shape(); } #endif ret = do_forward_layer(layer, blob_mats, opt);