Skip to content

Commit 7dd4bcc

Browse files
committed
convert mxnet _contrib_BilinearResize2D
1 parent dcff44f commit 7dd4bcc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tools/mxnet/mxnet2ncnn.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,10 @@ int main(int argc, char** argv)
992992

993993
fprintf(pp, "%-16s", "Input");
994994
}
995+
else if (n.op == "_contrib_BilinearResize2D")
996+
{
997+
fprintf(pp, "%-16s", "Interp");
998+
}
995999
else if (n.op == "_contrib_MultiBoxDetection")
9961000
{
9971001
fprintf(pp, "%-16s", "DetectionOutput");
@@ -1396,6 +1400,19 @@ int main(int argc, char** argv)
13961400
// dummy input shape
13971401
// fprintf(pp, " 0 0 0");
13981402
}
1403+
else if (n.op == "_contrib_BilinearResize2D")
1404+
{
1405+
float scale_height = n.has_attr("scale_height") ? n.attr("scale_height") : 1.f;
1406+
float scale_width = n.has_attr("scale_width") ? n.attr("scale_width") : 1.f;
1407+
int height = n.has_attr("scale_height") ? 0 : n.attr("height");
1408+
int width = n.has_attr("scale_width") ? 0 : n.attr("width");
1409+
1410+
fprintf(pp, " 0=2");
1411+
fprintf(pp, " 1=%f", scale_height);
1412+
fprintf(pp, " 2=%f", scale_width);
1413+
fprintf(pp, " 3=%d", height);
1414+
fprintf(pp, " 4=%d", width);
1415+
}
13991416
else if (n.op == "_contrib_MultiBoxDetection")
14001417
{
14011418
float threshold = n.has_attr("threshold") ? n.attr("threshold") : 0.01f;

0 commit comments

Comments
 (0)