From 75ad1cc7490c38e47df892b9025320e2a2d175c9 Mon Sep 17 00:00:00 2001 From: daquexian Date: Mon, 2 Oct 2023 08:04:09 +0800 Subject: [PATCH] support tag in memorydata layer (#5061) Signed-off-by: daquexian --- src/layer/memorydata.cpp | 9 +++++---- src/layer/memorydata.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/layer/memorydata.cpp b/src/layer/memorydata.cpp index 6cd314d76b97..02a0e0be078c 100644 --- a/src/layer/memorydata.cpp +++ b/src/layer/memorydata.cpp @@ -28,6 +28,7 @@ int MemoryData::load_param(const ParamDict& pd) h = pd.get(1, 0); d = pd.get(11, 0); c = pd.get(2, 0); + load_type = pd.get(21, 1); return 0; } @@ -36,19 +37,19 @@ int MemoryData::load_model(const ModelBin& mb) { if (d != 0) { - data = mb.load(w, h, d, c, 1); + data = mb.load(w, h, d, c, load_type); } else if (c != 0) { - data = mb.load(w, h, c, 1); + data = mb.load(w, h, c, load_type); } else if (h != 0) { - data = mb.load(w, h, 1); + data = mb.load(w, h, load_type); } else if (w != 0) { - data = mb.load(w, 1); + data = mb.load(w, load_type); } else // 0 0 0 { diff --git a/src/layer/memorydata.h b/src/layer/memorydata.h index 4b2c697912f8..d5175ad0dd8a 100644 --- a/src/layer/memorydata.h +++ b/src/layer/memorydata.h @@ -35,6 +35,7 @@ class MemoryData : public Layer int h; int d; int c; + int load_type; Mat data; };