[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>
pull/2642/head
jayggh 2023-02-27 19:03:46 +08:00 committed by GitHub
parent 4adddfddf0
commit ec63932333
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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)