From c1889ce397006aac0539dea5b698dc16026e7ce2 Mon Sep 17 00:00:00 2001 From: hzx Date: Tue, 10 Dec 2024 10:39:44 +0800 Subject: [PATCH 1/2] update mTuneLws when updateCache is called. --- express/Executor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/express/Executor.cpp b/express/Executor.cpp index 4b48c0d90..6c370d6a4 100644 --- a/express/Executor.cpp +++ b/express/Executor.cpp @@ -376,9 +376,9 @@ void Executor::RuntimeManager::updateCache() { MNN_PRINT("Update cache to %s, size = %zu\n", mInside->mCache->cacheFile.c_str(), buffer.second); writeCacheFile(mInside->mCache, buffer); mInside->mCache->lastCacheSize = buffer.second; + // Reset cache + loadCache(mInside->mInfo, buffer.first, buffer.second); } - // Reset cache - loadCache(mInside->mInfo, nullptr, 0); } std::vector Executor::RuntimeManager::isBackendSupport(const std::vector types) { From cba6e2500b86feafc9c6d6b7f24ec761acd68739 Mon Sep 17 00:00:00 2001 From: xiaying Date: Tue, 10 Dec 2024 15:22:03 +0800 Subject: [PATCH 2/2] MNN:Bugfix: Fix bug for https://github.com/alibaba/MNN/issues/3058 --- source/utils/InitNet.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/utils/InitNet.cpp b/source/utils/InitNet.cpp index 2c196851c..22ae22c64 100644 --- a/source/utils/InitNet.cpp +++ b/source/utils/InitNet.cpp @@ -204,6 +204,9 @@ bool initTensors(std::vector>& tensors, const Net* net, } auto blob = des->blob(); auto& tb = tensors[index]->buffer(); + if (nullptr == blob) { + continue; + } if (auto idims = blob->dims()) { for (int d = 0; d < idims->size(); d++) { tb.dim[d].extent = idims->Get(d);