Unverified Commit ec639323 authored by jayggh's avatar jayggh Committed by GitHub
Browse files

[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: default avatarZaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update fused_bias_leakyrelu.py

* Update fused_bias_leakyrelu.py

---------
Co-authored-by: default avatarZaida Zhou <58739961+zhouzaida@users.noreply.github.com>
parent 4adddfdd
...@@ -257,7 +257,7 @@ def fused_bias_leakyrelu(input: torch.Tensor, ...@@ -257,7 +257,7 @@ def fused_bias_leakyrelu(input: torch.Tensor,
Returns: Returns:
torch.Tensor: Feature map after non-linear activation. 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': if not input.is_cuda and input.device.type != 'npu':
return bias_leakyrelu_ref(input, bias, negative_slope, scale) return bias_leakyrelu_ref(input, bias, negative_slope, scale)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment