Skip to content

Commit

Permalink
convert _minus_scalar and _mul_scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed May 9, 2018
1 parent a341e74 commit d6e1b82
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tools/mxnet/mxnet2ncnn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,14 @@ int main(int argc, char** argv)

fprintf(pp, "%-16s", "Input");
}
else if (n.op == "_minus_scalar")
{
fprintf(pp, "%-16s", "BinaryOp");
}
else if (n.op == "_mul_scalar")
{
fprintf(pp, "%-16s", "BinaryOp");
}
else if (n.op == "abs")
{
fprintf(pp, "%-16s", "UnaryOp");
Expand Down Expand Up @@ -1062,6 +1070,24 @@ int main(int argc, char** argv)
// dummy input shape
// fprintf(pp, " 0 0 0");
}
else if (n.op == "_minus_scalar")
{
int op_type = 1;
int with_scalar = 1;
float scalar = n.attr("scalar");
fprintf(pp, " 0=%d", op_type);
fprintf(pp, " 1=%d", with_scalar);
fprintf(pp, " 2=%f", scalar);
}
else if (n.op == "_mul_scalar")
{
int op_type = 2;
int with_scalar = 1;
float scalar = n.attr("scalar");
fprintf(pp, " 0=%d", op_type);
fprintf(pp, " 1=%d", with_scalar);
fprintf(pp, " 2=%f", scalar);
}
else if (n.op == "abs")
{
int op_type = 0;
Expand Down

0 comments on commit d6e1b82

Please sign in to comment.