From ec6393233388a14047b3a4d6402f4aef23a7b5b6 Mon Sep 17 00:00:00 2001 From: jayggh <35617559+jayggh@users.noreply.github.com> Date: Mon, 27 Feb 2023 19:03:46 +0800 Subject: [PATCH] [Enhance] The argument scale of fused_bias_leakyrelu should be greater than 0 (#2623) * Add verification for scale, when scale less than 0 * Update mmcv/ops/fused_bias_leakyrelu.py Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> * Update fused_bias_leakyrelu.py * Update fused_bias_leakyrelu.py --------- Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> --- mmcv/ops/fused_bias_leakyrelu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmcv/ops/fused_bias_leakyrelu.py b/mmcv/ops/fused_bias_leakyrelu.py index fe17d2db7..5c0e6d92d 100644 --- a/mmcv/ops/fused_bias_leakyrelu.py +++ b/mmcv/ops/fused_bias_leakyrelu.py @@ -257,7 +257,7 @@ def fused_bias_leakyrelu(input: torch.Tensor, Returns: torch.Tensor: Feature map after non-linear activation. """ - + assert scale > 0, 'The scale should be greater than 0' if not input.is_cuda and input.device.type != 'npu': return bias_leakyrelu_ref(input, bias, negative_slope, scale)