Skip to content

Commit 25564e3

Browse files
committed
fix lint and division by zero
Change-Id: Ia79d879399ad7f2d098fd4a0af5c29a89565133e
1 parent 613e662 commit 25564e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/tvm/topi/arm_cpu/injective.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# under the License.
1717
# pylint: disable=invalid-name, unused-variable
1818
"""Schedule for pooling operators"""
19-
import numpy as np
2019
import tvm
2120
from tvm import te
2221
from ..utils import is_empty_shape
@@ -69,7 +68,8 @@ def schedule_injective(outs):
6968
if list(s[x].op.axis):
7069
# do not vectorize for broadcast
7170
dtype = "uint16" if x.dtype == "bfloat16" else x.dtype
72-
(io, ii) = s[x].split(list(s[x].op.axis)[-1], 16 // (tvm.DataType(dtype).bits // 8))
71+
itemsize = max(1, tvm.DataType(dtype).bits // 8)
72+
(io, ii) = s[x].split(list(s[x].op.axis)[-1], 16 // itemsize)
7373
s[x].vectorize(ii)
7474
tvm.te.schedule.AutoInlineInjective(s)
7575

0 commit comments

Comments
 (0)