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; };