Browse Source

convert PRelu

tags/20180704
nihui 8 years ago
parent
commit
99c243183b
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      tools/onnx/onnx2ncnn.cpp

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

@@ -552,6 +552,10 @@ int main(int argc, char** argv)
{
fprintf(pp, "%-16s", "Padding");
}
else if (op == "PRelu")
{
fprintf(pp, "%-16s", "PReLU");
}
else if (op == "Relu")
{
fprintf(pp, "%-16s", "ReLU");
@@ -1056,6 +1060,16 @@ int main(int argc, char** argv)
fprintf(pp, " 4=%d", type);
fprintf(pp, " 5=%f", value);
}
else if (op == "PRelu")
{
const onnx::TensorProto& slope = weights[node.input(1)];

int num_slope = get_tensor_proto_data_size(slope);

fprintf(pp, " 0=%d", num_slope);

fwrite_tensor_proto_data(slope, bp);
}
else if (op == "Reshape")
{
std::vector<int> shape = get_node_attr_ai(node, "shape");


Loading…
Cancel
Save