Skip to content

Commit

Permalink
[RELAY] Fix get_int_tuple for shape like '(1001,)' (#2691)
Browse files Browse the repository at this point in the history
tshape.strip('()[]').split(',') will make a list ['1001',''] but the empty one isn't needed.
  • Loading branch information
lixiaoquan authored and tqchen committed Feb 28, 2019
1 parent 2bf3458 commit bd78079
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/tvm/relay/frontend/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_int_tuple(self, key, default=RequiredAttr()):
"""
if key in self.attrs:
tshape = self.attrs[key]
return tuple(int(x.strip()) for x in tshape.strip('()[]').split(','))
return tuple(int(x.strip()) for x in tshape.strip('()[]').split(',') if x)
if isinstance(default, RequiredAttr):
raise AttributeError("Required attribute {} not found.".format(key))
return default
Expand Down

0 comments on commit bd78079

Please sign in to comment.