提交 9cbdc34b authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Disallow 'cpu', 'cuda*' and 'opencl*' and context name.

上级 9cbd604e
...@@ -121,6 +121,9 @@ class ContextsParam(ConfigParam): ...@@ -121,6 +121,9 @@ class ContextsParam(ConfigParam):
s = v.split('->') s = v.split('->')
if len(s) != 2: if len(s) != 2:
raise ValueError("Malformed context map: %s" % (v,)) raise ValueError("Malformed context map: %s" % (v,))
if (s[0] == 'cpu' or s[0].startswith('cuda') or
s[0].startswith('opencl')):
raise ValueError("Cannot use %s as context name" % (s[0],))
return val return val
ConfigParam.__init__(self, '', filter, False) ConfigParam.__init__(self, '', filter, False)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论