From 61da11d9c5f473ebca0d1091dc11ef75a21b9748 Mon Sep 17 00:00:00 2001 From: Li Xiaoquan Date: Thu, 28 Feb 2019 09:10:41 +0800 Subject: [PATCH] [RELAY] Fix get_int_tuple for shape like '(1001,)' tshape.strip('()[]').split(',') will make a list ['1001',''] but the empty one isn't needed. --- python/tvm/relay/frontend/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tvm/relay/frontend/common.py b/python/tvm/relay/frontend/common.py index be23f2b50273..ef9f63f3cd95 100644 --- a/python/tvm/relay/frontend/common.py +++ b/python/tvm/relay/frontend/common.py @@ -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