提交 e1c763e1 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Add a pretty print for GpuArrayType.

上级 aeac604e
...@@ -27,7 +27,10 @@ class GpuArrayType(Type): ...@@ -27,7 +27,10 @@ class GpuArrayType(Type):
except gpuarray.GpuArrayException: except gpuarray.GpuArrayException:
raise TypeError("Unsupported dtype for %s: %s" % raise TypeError("Unsupported dtype for %s: %s" %
(self.__class__.__name__, self.dtype)) (self.__class__.__name__, self.dtype))
def __str__(self):
return "GpuArrayType(%s, %s)" % (self.dtype, self.broadcastable)
def filter(self, data, strict=False, allow_downcast=None): def filter(self, data, strict=False, allow_downcast=None):
if strict: if strict:
if not isinstance(data, gpuarray.GpuArray): if not isinstance(data, gpuarray.GpuArray):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论