Skip to content

Commit

Permalink
fix pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrookhart committed Feb 9, 2021
1 parent 52f09ee commit 70894a1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions python/tvm/relay/frontend/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,8 @@ def _impl_v9(cls, inputs, attr, params):
def shape_of(x, dtype="int64"):
ttype = infer_type(x).checked_type
if not _ty.is_dynamic(ttype):
return _expr.const([i for i in ttype.shape], dtype)
shape = list(ttype.shape)
return _expr.const(shape, dtype)
return _op.shape_of(x, "int64")


Expand Down Expand Up @@ -1549,13 +1550,12 @@ class Constant(OnnxOpConverter):

@classmethod
def _impl_v9(cls, inputs, attr, params):
if "value" in attr:
np_value = get_numpy(attr.pop("value"))
dtype = np_value.dtype.name
value = _expr.const(np_value, dtype)
return value
else:
if "value" not in attr:
raise "No Value in Constant"
np_value = get_numpy(attr.pop("value"))
dtype = np_value.dtype.name
value = _expr.const(np_value, dtype)
return value


class Sign(OnnxOpConverter):
Expand Down

0 comments on commit 70894a1

Please sign in to comment.