From 99c243183bb324a8a6e07bac58a5fe7e228fcfc1 Mon Sep 17 00:00:00 2001 From: nihui Date: Sat, 12 May 2018 13:30:57 +0800 Subject: [PATCH] convert PRelu --- tools/onnx/onnx2ncnn.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/onnx/onnx2ncnn.cpp b/tools/onnx/onnx2ncnn.cpp index b21f68b1f..e2d3cb242 100644 --- a/tools/onnx/onnx2ncnn.cpp +++ b/tools/onnx/onnx2ncnn.cpp @@ -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 shape = get_node_attr_ai(node, "shape");