Skip to content

Commit b92d317

Browse files
committed
Fix lint
1 parent edd94cb commit b92d317

File tree

4 files changed

+14
-39
lines changed

4 files changed

+14
-39
lines changed

python/tvm/topi/adreno/conv2d_nchw_winograd.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,7 @@
1818
"""Winograd NCHW template for Adreno backend"""
1919

2020
import logging
21-
import tvm
22-
from tvm import te
2321
from tvm import autotvm
24-
25-
from tvm.topi import nn
26-
from tvm.topi.utils import get_const_int, get_const_tuple, traverse_inline
27-
from ..nn.winograd_util import winograd_transform_matrices
28-
from .utils import (
29-
split_to_chunks,
30-
pack_input,
31-
pack_filter,
32-
bind_data_copy,
33-
get_texture_storage,
34-
infer_tile_size,
35-
)
3622
from .conv2d_winograd_common import conv2d_winograd_comp, schedule_conv2d_winograd_impl
3723

3824

@@ -137,4 +123,6 @@ def conv2d_nchw_winograd_comp(
137123
output: tvm.te.Tensor
138124
4-D or 5-D with shape NCHW or NCHW4c
139125
"""
140-
return conv2d_winograd_comp(cfg, data, kernel, strides, padding, dilation, out_dtype, args, pre_computed, "NCHW")
126+
return conv2d_winograd_comp(
127+
cfg, data, kernel, strides, padding, dilation, out_dtype, args, pre_computed, "NCHW"
128+
)

python/tvm/topi/adreno/conv2d_nhwc_winograd.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,7 @@
1818
"""Winograd NHWC template for Adreno backend"""
1919

2020
import logging
21-
import tvm
22-
from tvm import te
2321
from tvm import autotvm
24-
25-
from tvm.topi import nn
26-
from tvm.topi.utils import get_const_int, get_const_tuple, traverse_inline
27-
from ..nn.winograd_util import winograd_transform_matrices
28-
from .utils import (
29-
split_to_chunks,
30-
pack_input,
31-
pack_filter,
32-
bind_data_copy,
33-
get_texture_storage,
34-
infer_tile_size,
35-
)
3622
from .conv2d_winograd_common import conv2d_winograd_comp, schedule_conv2d_winograd_impl
3723

3824

@@ -137,4 +123,6 @@ def conv2d_nhwc_winograd_comp(
137123
output: tvm.te.Tensor
138124
4-D or 5-D with shape NCHW or NCHW4c
139125
"""
140-
return conv2d_winograd_comp(cfg, data, kernel, strides, padding, dilation, out_dtype, args, pre_computed, "NHWC")
126+
return conv2d_winograd_comp(
127+
cfg, data, kernel, strides, padding, dilation, out_dtype, args, pre_computed, "NHWC"
128+
)

python/tvm/topi/adreno/conv2d_winograd_common.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# pylint: disable=invalid-name,unused-variable,unused-argument
1818
"""Common Winograd implementation for Adreno backend"""
1919

20-
import logging
2120
import tvm
2221
from tvm import te
2322
from tvm import autotvm
@@ -80,7 +79,7 @@ def conv2d_winograd_comp(
8079
output: tvm.te.Tensor
8180
4-D or 5-D with shape NCHW or NCHW4c
8281
"""
83-
assert layout == "NCHW" or layout == "NHWC"
82+
assert layout in ("NCHW", "NHWC")
8483
tile_size = infer_tile_size(data, layout)
8584

8685
if isinstance(dilation, int):
@@ -301,9 +300,9 @@ def conv2d_winograd_comp(
301300
else:
302301
output = te.compute(
303302
(N, CO, H, W, COB),
304-
lambda n, co, h, w, cob: inverse[co][n * nH * nW + idxdiv(h, m) * nW + idxdiv(w, m)][
305-
idxmod(h, m)
306-
][idxmod(w, m)][cob].astype(out_dtype),
303+
lambda n, co, h, w, cob: inverse[co][
304+
n * nH * nW + idxdiv(h, m) * nW + idxdiv(w, m)
305+
][idxmod(h, m)][idxmod(w, m)][cob].astype(out_dtype),
307306
name="output",
308307
tag="cast_from_acc" + args["accumulator"][-2:],
309308
)
@@ -320,9 +319,9 @@ def conv2d_winograd_comp(
320319
else:
321320
output = te.compute(
322321
(N, H, W, CO, COB),
323-
lambda n, h, w, co, cob: inverse[co][n * nH * nW + idxdiv(h, m) * nW + idxdiv(w, m)][
324-
idxmod(h, m)
325-
][idxmod(w, m)][cob].astype(out_dtype),
322+
lambda n, h, w, co, cob: inverse[co][
323+
n * nH * nW + idxdiv(h, m) * nW + idxdiv(w, m)
324+
][idxmod(h, m)][idxmod(w, m)][cob].astype(out_dtype),
326325
name="output",
327326
tag="cast_from_acc" + args["accumulator"][-2:],
328327
)

src/runtime/opencl/texture_pool.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace tvm {
3030
namespace runtime {
3131

3232
void* Pool2D::Alloc(Device dev, DeviceAPI* device, size_t width, size_t height,
33-
DLDataType type_hint) {
33+
DLDataType type_hint) {
3434
Entry e;
3535
Entry new_mem;
3636
// Processed several experiments and found that when we are trying to fit

0 commit comments

Comments
 (0)