Skip to content

Commit

Permalink
[fix] fix reshape param default value
Browse files Browse the repository at this point in the history
  • Loading branch information
IctHu committed Feb 27, 2024
1 parent 218c8b0 commit aa8949a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ppl/nn/models/onnx/parsers/pmx/parse_reshape_param.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RetCode ParseReshapeParam(const ::onnx::NodeProto& pb_node, const onnx::ParamPar
ir::Attr* arg) {
auto param = static_cast<onnx::ReshapeParam*>(arg);

param->allowzero = 1;
param->allowzero = 0;

node->SetType({"", "Reshape", 14});

Expand Down
2 changes: 1 addition & 1 deletion src/ppl/nn/oputils/onnx/reshape_reshape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit aa8949a

Please sign in to comment.