Skip to content

Commit

Permalink
support tag in memorydata layer
Browse files Browse the repository at this point in the history
Signed-off-by: daquexian <daquexian566@gmail.com>
  • Loading branch information
daquexian committed Sep 30, 2023
1 parent f38fc95 commit cabe48c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/layer/memorydata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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
{
Expand Down
1 change: 1 addition & 0 deletions src/layer/memorydata.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class MemoryData : public Layer
int h;
int d;
int c;
int load_type;

Mat data;
};
Expand Down

0 comments on commit cabe48c

Please sign in to comment.