提交 ae37480f authored 作者: Frederic Bastien's avatar Frederic Bastien

fix backport

上级 a479d036
...@@ -119,13 +119,15 @@ class CudaNdarrayType(Type): ...@@ -119,13 +119,15 @@ class CudaNdarrayType(Type):
else: else:
b = self.broadcastable b = self.broadcastable
#bcast = str(self.broadcastable) #bcast = str(self.broadcastable)
s=len(b) if not any(b):
if numpy.any(b): s = str(b) s="%iD" % len(b)
else: s=str(b)
bcast = {(): 'scalar', bcast = {(): 'scalar',
(False,): 'vector', (False,): 'vector',
(False, True): 'col', (False, True): 'col',
(True, False): 'row', (True, False): 'row',
(False, False): 'matrix'}.get(b, "%iD" % s) (False, False): 'matrix'}.get(b, s)
return "CudaNdarrayType(%s, %s)" % (str(self.dtype), bcast) return "CudaNdarrayType(%s, %s)" % (str(self.dtype), bcast)
def __repr__(self): def __repr__(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论