From 8639cf9c645ba6cc59fd0beed610a0d4498a089b Mon Sep 17 00:00:00 2001 From: gaofangshu Date: Thu, 27 Jul 2017 11:59:38 +0800 Subject: [PATCH] Modified `parse_table` function. --- torchcraft_py/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/torchcraft_py/utils.py b/torchcraft_py/utils.py index 47b2d4e..6f6fbdf 100644 --- a/torchcraft_py/utils.py +++ b/torchcraft_py/utils.py @@ -1,3 +1,5 @@ +import re + def print_err(msg): raise RuntimeError(msg) @@ -50,7 +52,7 @@ def parse_table(s): return result s = s[1:-1] - kvs = s.split(',') + kvs = re.split(r',(?=[a-zA-Z])',s) for kv in kvs: if len(kv) == 0: continue