提交 8884e693 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix misscoped allow_downcast block.

上级 be838ed8
...@@ -189,13 +189,13 @@ class GpuArrayType(Type): ...@@ -189,13 +189,13 @@ class GpuArrayType(Type):
if self.context != data.context: if self.context != data.context:
raise TypeError("data context does not match type context") raise TypeError("data context does not match type context")
# fallthrough to ndim check # fallthrough to ndim check
elif (allow_downcast or elif (allow_downcast or
(allow_downcast is None and (allow_downcast is None and
type(data) == float and type(data) == float and
self.dtype == config.floatX)): self.dtype == config.floatX)):
data = gpuarray.array(data, dtype=self.typecode, copy=False, data = gpuarray.array(data, dtype=self.typecode, copy=False,
ndmin=len(self.broadcastable), ndmin=len(self.broadcastable),
context=self.context) context=self.context)
else: else:
if not hasattr(data, 'dtype'): if not hasattr(data, 'dtype'):
# This is to convert objects that don't have a dtype # This is to convert objects that don't have a dtype
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论