chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:33:03 +08:00
commit 5b57521aa1
8226 changed files with 3425766 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#include "CPUResizeCache.hpp"
#include "../../core/TensorUtils.hpp"
namespace MNN {
Tensor* CPUResizeCache::findCacheTensor(const Tensor* src, MNN_DATA_FORMAT format) const {
auto iter = mFormatCache.find(std::make_pair(src, format));
if (iter == mFormatCache.end()) {
return nullptr;
}
return iter->second.get();
}
void CPUResizeCache::pushCacheTensor(std::shared_ptr<Tensor> dst, const Tensor* src, MNN_DATA_FORMAT format) {
MNN_ASSERT(mFormatCache.find(std::make_pair(src, format)) == mFormatCache.end());
mFormatCache.insert(std::make_pair(std::make_pair(src, format), dst));
}
void CPUResizeCache::reset() {
mFormatCache.clear();
}
void CPUResizeCache::release() {
for (auto iter : mFormatCache) {
TensorUtils::getDescribeOrigin(iter.second.get())->mem = nullptr;
}
}
};