mirror of https://github.com/open-mmlab/mmcv.git
[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
parent
4adddfddf0
commit
ec63932333
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue