Skip to content

Commit

Permalink
support tag in memorydata layer (#5061)
Browse files Browse the repository at this point in the history
Signed-off-by: daquexian <[email protected]>
  • Loading branch information
daquexian authored Oct 2, 2023
1 parent f38fc95 commit 75ad1cc
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 75ad1cc

Please sign in to comment.