提交 9c9a5a51 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

The bug mentioned was fixed in numpy 1.6 and we support 1.6.2 at minimum.

上级 b73adff1
...@@ -5937,17 +5937,8 @@ class test_arithmetic_cast(unittest.TestCase): ...@@ -5937,17 +5937,8 @@ class test_arithmetic_cast(unittest.TestCase):
config.int_division == 'raise') config.int_division == 'raise')
# This is the expected behavior. # This is the expected behavior.
continue continue
# For numpy we have a problem: numpy_dtype = op(numpy_args[0](a_type),
# http://projects.scipy.org/numpy/ticket/1827 numpy_args[1](b_type)).dtype
# As a result we only consider the highest data
# type that numpy may return.
numpy_dtypes = [
op(numpy_args[0](a_type),
numpy_args[1](b_type)).dtype,
op(numpy_args[1](b_type),
numpy_args[0](a_type)).dtype]
numpy_dtype = theano.scalar.upcast(
*map(str, numpy_dtypes))
if numpy_dtype == theano_dtype: if numpy_dtype == theano_dtype:
# Same data type found, all is good! # Same data type found, all is good!
continue continue
...@@ -5979,9 +5970,7 @@ class test_arithmetic_cast(unittest.TestCase): ...@@ -5979,9 +5970,7 @@ class test_arithmetic_cast(unittest.TestCase):
# Theano upcasted the result array. # Theano upcasted the result array.
theano_dtype == up_type and theano_dtype == up_type and
# But Numpy kept its original type. # But Numpy kept its original type.
# (not an equality because of numpy bug array_type == numpy_dtype):
# mentioned above).
array_type in numpy_dtypes):
# Then we accept this difference in # Then we accept this difference in
# behavior. # behavior.
continue continue
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论