Browse Source

convert onnx Flatten

tags/20181228
nihui 7 years ago
parent
commit
bbe044f385
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      tools/onnx/onnx2ncnn.cpp

+ 12
- 0
tools/onnx/onnx2ncnn.cpp View File

@@ -556,6 +556,10 @@ int main(int argc, char** argv)
{ {
fprintf(pp, "%-16s", "UnaryOp"); fprintf(pp, "%-16s", "UnaryOp");
} }
else if (op == "Flatten")
{
fprintf(pp, "%-16s", "Flatten");
}
else if (op == "Floor") else if (op == "Floor")
{ {
fprintf(pp, "%-16s", "UnaryOp"); fprintf(pp, "%-16s", "UnaryOp");
@@ -1081,6 +1085,14 @@ int main(int argc, char** argv)
int op_type = 7; int op_type = 7;
fprintf(pp, " 0=%d", op_type); fprintf(pp, " 0=%d", op_type);
} }
else if (op == "Flatten")
{
int axis = get_node_attr_i(node, "axis", 1);
if (axis != 1)
{
fprintf(stderr, "Unsupported Flatten axis %d!\n", axis);
}
}
else if (op == "Floor") else if (op == "Floor")
{ {
int op_type = 2; int op_type = 2;


Loading…
Cancel
Save