提交 a06fadf9 authored 作者: Chinnadhurai Sankar's avatar Chinnadhurai Sankar 提交者: Pascal Lamblin

fix bug in custom bitwise_reduce func & bump cache version for travis

上级 a8e715d9
......@@ -1557,7 +1557,7 @@ class AND(BinaryBitOp):
return "%(z)s = (%(x)s & %(y)s);" % locals()
def c_code_cache_version(self):
return (2,)
return (2.1,)
and_ = AND()
......
......@@ -333,9 +333,9 @@ class test_Broadcast(unittest.TestCase):
def reduce_bitwise_and(x, axis=-1, dtype='int8'):
identity = numpy.array((-1,), dtype=dtype)[0]
if 0 in x.shape and x.shape[axis] != 0:
new_shape = tuple([s for i, s in enumerate(x.shape) if i != axis])
return numpy.empty(shape=new_shape, dtype=x.dtype)
shape_without_axis = tuple([s for i, s in enumerate(x.shape) if i != axis])
if 0 in shape_without_axis:
return numpy.empty(shape=shape_without_axis, dtype=x.dtype)
def custom_reduce(a):
out = identity
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论