Skip to content

Commit f19d3e7

Browse files
authored
add judge in npu ops (#3266)
* add judge in npu ops * fix lint * fix lint 1 * fix if_else
1 parent ebad94a commit f19d3e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mmcv/ops/fused_bias_leakyrelu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ def fused_bias_leakyrelu(input: torch.Tensor,
258258
torch.Tensor: Feature map after non-linear activation.
259259
"""
260260

261-
if (not input.is_cuda) and (not input.is_musa):
261+
if (not input.is_cuda) and (not input.is_musa) and \
262+
input.device.type != 'npu':
262263
return bias_leakyrelu_ref(input, bias, negative_slope, scale)
263264

264265
return FusedBiasLeakyReLUFunction.apply(input, bias.to(input.dtype),

0 commit comments

Comments
 (0)