提交 6e3e96e4 authored 作者: Frederic's avatar Frederic

Better error message.

上级 eac70d33
...@@ -59,7 +59,9 @@ class HostFromGpu(GpuOp): ...@@ -59,7 +59,9 @@ class HostFromGpu(GpuOp):
def make_node(self, x): def make_node(self, x):
if not isinstance(x.type, CudaNdarrayType): if not isinstance(x.type, CudaNdarrayType):
raise TypeError(x) raise TypeError("Expected a Theano variable with type "
"CudaNdarrayType. Got %s with type %s" % (x,
x.type))
return Apply(self, [x], [tensor.TensorType(dtype=x.dtype, return Apply(self, [x], [tensor.TensorType(dtype=x.dtype,
broadcastable=x.broadcastable)()]) broadcastable=x.broadcastable)()])
...@@ -113,7 +115,9 @@ class GpuFromHost(GpuOp): ...@@ -113,7 +115,9 @@ class GpuFromHost(GpuOp):
def make_node(self, x): def make_node(self, x):
if not isinstance(x.type, tensor.TensorType): if not isinstance(x.type, tensor.TensorType):
raise TypeError(x) raise TypeError("Expected a Theano variable with type "
"TensorType. Got %s with type %s" % (x,
x.type))
return Apply(self, [x], [CudaNdarrayType(broadcastable=x.broadcastable, return Apply(self, [x], [CudaNdarrayType(broadcastable=x.broadcastable,
dtype=x.dtype)()]) dtype=x.dtype)()])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论