Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
masa authored and masahi committed Oct 1, 2020
1 parent 5a1341b commit 63f3f7f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/tvm/relay/frontend/qnn_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(
self.groups = groups


def get_quant_params(qweight):
def _get_quant_params(qweight):
import torch

weight_np = qweight.dequantize().numpy()
Expand All @@ -88,12 +88,12 @@ def get_quant_params(qweight):


def make_qnn_param(param_name, qweight, bias):
weight_np, scale, zero_point = get_quant_params(qweight)
weight_np, scale, zero_point = _get_quant_params(qweight)
return QNNParam(weight_np, bias, scale, zero_point, param_name)


def make_conv_packed_param(param_name, qweight, bias, packed_params):
weight_np, scale, zero_point = get_quant_params(qweight)
weight_np, scale, zero_point = _get_quant_params(qweight)
stride = packed_params.stride()
padding = packed_params.padding()
dilation = packed_params.dilation()
Expand Down Expand Up @@ -126,7 +126,8 @@ def filter_func(named_module):
# and loaded back
# This module can be safely ignored
continue
elif len(state_dict) == 0 and hasattr(m, param_name):

if len(state_dict) == 0 and hasattr(m, param_name):
# for v1.6 and above
packed_params = m._packed_params
else:
Expand Down

0 comments on commit 63f3f7f

Please sign in to comment.