From aa8949ace07d26df5e777be9add1e50fb4c09e33 Mon Sep 17 00:00:00 2001 From: IctHu Date: Tue, 27 Feb 2024 14:15:33 +0800 Subject: [PATCH] [fix] fix reshape param default value --- src/ppl/nn/models/onnx/parsers/pmx/parse_reshape_param.cc | 2 +- src/ppl/nn/oputils/onnx/reshape_reshape.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ppl/nn/models/onnx/parsers/pmx/parse_reshape_param.cc b/src/ppl/nn/models/onnx/parsers/pmx/parse_reshape_param.cc index b008bf7d2..b26803292 100644 --- a/src/ppl/nn/models/onnx/parsers/pmx/parse_reshape_param.cc +++ b/src/ppl/nn/models/onnx/parsers/pmx/parse_reshape_param.cc @@ -27,7 +27,7 @@ RetCode ParseReshapeParam(const ::onnx::NodeProto& pb_node, const onnx::ParamPar ir::Attr* arg) { auto param = static_cast(arg); - param->allowzero = 1; + param->allowzero = 0; node->SetType({"", "Reshape", 14}); diff --git a/src/ppl/nn/oputils/onnx/reshape_reshape.cc b/src/ppl/nn/oputils/onnx/reshape_reshape.cc index 1741e23c1..5896bef20 100644 --- a/src/ppl/nn/oputils/onnx/reshape_reshape.cc +++ b/src/ppl/nn/oputils/onnx/reshape_reshape.cc @@ -46,7 +46,7 @@ RetCode ReshapeReshape(InputOutputInfo* info, const ir::Attr* arg, const int64_t LOG(DEBUG) << "ERROR: axis_need_infer[" << axis_need_infer << "] != -1."; return RC_INVALID_VALUE; } - } else if (shape_data[i] == 0 && param->allowzero) { + } else if (shape_data[i] == 0 && !param->allowzero) { if (i < data->GetDimCount()) { reshaped->SetDim(i, data->GetDim(i)); } else {