提交 a286bf13 authored 作者: James Bergstra's avatar James Bergstra

TensorType - make sure that broadcastable is a tuple of bools

上级 81166171
...@@ -331,7 +331,8 @@ class TensorType(Type): ...@@ -331,7 +331,8 @@ class TensorType(Type):
self.dtype = str(dtype) self.dtype = str(dtype)
if self.dtype=='floatX': if self.dtype=='floatX':
self.dtype=config.floatX self.dtype=config.floatX
self.broadcastable = tuple(broadcastable) ### broadcastable is immutable, and all elements are either True or False
self.broadcastable = tuple(bool(b) for b in broadcastable)
self.dtype_specs() # error checking is done there self.dtype_specs() # error checking is done there
self.name = name self.name = name
self.numpy_dtype = numpy.dtype(self.dtype) self.numpy_dtype = numpy.dtype(self.dtype)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论