Skip to content

Commit

Permalink
[Operator][Update] Update relu6 for paddlepaddle2.5 (#1198)
Browse files Browse the repository at this point in the history
* update relu6 for paddlepaddle2.5

* update relu6 for paddlepaddle2.5
  • Loading branch information
Zheng-Bicheng authored Feb 27, 2024
1 parent 0386ba5 commit 24484b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion paddle2onnx/mapper/activation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ void Relu6Mapper::Opset7() {
auto input_info = GetInput("X");
auto output_info = GetOutput("Out");
float min = 0.0;
helper_->Clip(input_info[0].name, output_info[0].name, min, 6, input_info[0].dtype);
float threshold = 6.0;
if (HasAttr("threshold")) {
GetAttr("threshold", &threshold);
}
helper_->Clip(input_info[0].name, output_info[0].name, min, threshold, input_info[0].dtype);
}

int32_t PReluMapper::GetMinOpset(bool verbose) {
Expand Down
3 changes: 2 additions & 1 deletion tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
#tar xf quantized_models.tar.gz

cases=$(find . -name "test*.py" | sort)
ignore="test_auto_scan_roi_align.py \ # need to be rewrite
ignore="test_auto_scan_multiclass_nms.py
test_auto_scan_roi_align.py \ # need to be rewrite
test_auto_scan_pool_adaptive_max_ops.py \
test_auto_scan_isx_ops.py \
test_auto_scan_masked_select.py \
Expand Down

0 comments on commit 24484b9

Please sign in to comment.