Skip to content

Commit

Permalink
Reset debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
jroesch committed Feb 19, 2021
1 parent dc2e968 commit 56772fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
16 changes: 7 additions & 9 deletions python/tvm/relay/analysis/sparse_dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"""
from collections import namedtuple
import numpy as np

from ... import nd, runtime
import scipy.sparse as sp
import tvm
from . import _ffi_api


Expand Down Expand Up @@ -73,8 +73,6 @@ def process_params(expr, params, block_size, sparsity_threshold):
ret : Namedtuple[weight_name: Array[String], weight_shape: Array[Array[IntImm]]]
return names of qualified dense weight and the shape in BSR format
"""
import scipy.sparse as sp

memo = SparseAnalysisResult(weight_name=[], weight_shape=[])
weight_names = _search_dense_op_weight(expr)
for name in weight_names:
Expand All @@ -91,11 +89,11 @@ def process_params(expr, params, block_size, sparsity_threshold):
+ list(sparse_weight.indices.shape)
+ list(sparse_weight.indptr.shape)
)
params[name + ".data"] = nd.array(sparse_weight.data)
params[name + ".indices"] = nd.array(sparse_weight.indices)
params[name + ".indptr"] = nd.array(sparse_weight.indptr)
params[name + ".data"] = tvm.nd.array(sparse_weight.data)
params[name + ".indices"] = tvm.nd.array(sparse_weight.indices)
params[name + ".indptr"] = tvm.nd.array(sparse_weight.indptr)
ret = SparseAnalysisResult(
weight_name=runtime.convert(memo.weight_name),
weight_shape=runtime.convert(memo.weight_shape),
weight_name=tvm.runtime.convert(memo.weight_name),
weight_shape=tvm.runtime.convert(memo.weight_shape),
)
return ret
3 changes: 1 addition & 2 deletions python/tvm/topi/testing/conv1d_transpose_ncw_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# pylint: disable=unused-variable
"""Transposed 1D convolution in python"""
import numpy as np
import scipy
import tvm.topi.testing
from tvm.topi.nn.utils import get_pad_tuple1d

Expand Down Expand Up @@ -50,8 +51,6 @@ def conv1d_transpose_ncw_python(a_np, w_np, stride, padding, output_padding):
3-D with shape [batch, out_channel, out_width]
"""
import scipy

batch, in_c, in_w = a_np.shape
_, out_c, filter_w = w_np.shape
opad = output_padding[0]
Expand Down
3 changes: 1 addition & 2 deletions python/tvm/topi/testing/conv2d_hwcn_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# pylint: disable=invalid-name, line-too-long, unused-variable, too-many-locals
"""Convolution in python"""
import numpy as np
import scipy.signal
from tvm.topi.nn.utils import get_pad_tuple


Expand Down Expand Up @@ -44,8 +45,6 @@ def conv2d_hwcn_python(a_np, w_np, stride, padding):
b_np : np.ndarray
4-D with shape [out_height, out_width, out_channel, batch]
"""
import scipy.signal

in_height, in_width, in_channel, batch = a_np.shape
kernel_h, kernel_w, _, num_filter = w_np.shape
if isinstance(stride, int):
Expand Down

0 comments on commit 56772fa

Please sign in to comment.