Skip to content

Commit e2d09dd

Browse files
committed
The patch is to simplify the implmentation of QNNParam and make it more friendly to Python 2.x.
1 parent 324bf4c commit e2d09dd

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

python/tvm/relay/frontend/qnn_torch.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,12 @@
2828
from .pytorch_utils import is_version_greater_than, getattr_attr_name
2929

3030

31-
class QNNParam:
31+
class QNNParam(object):
3232
"""A placeholder for weight quantization parameters"""
3333

3434
def __init__(self, weight, bias, scale, zero_point):
3535
self.weight = weight
36-
37-
if bias is not None:
38-
self.bias = bias.detach().numpy()
39-
else:
40-
self.bias = None
41-
36+
self.bias = None if not bias else bias.detach().numpy()
4237
self.scale = _expr.const(scale)
4338
self.zero_point = _expr.const(zero_point, dtype="int32")
4439

0 commit comments

Comments
 (0)