提交 8193c4ff authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Add a check in the constructor of GpuArrayType to make sure the context_name is valid and defined.

上级 37edae4a
......@@ -92,6 +92,8 @@ class GpuArrayType(Type):
self.ndim = len(self.broadcastable)
self.name = name
self.context_name = context_name
# This will check that the passed context name is valid and registered.
get_context(self.context_name)
try:
self.typecode = gpuarray.dtype_to_typecode(self.dtype)
except gpuarray.GpuArrayException:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论