提交 f8b7e49b authored 作者: Frederic's avatar Frederic

Remove warning in test with numpy 1.10

上级 41be17f0
...@@ -973,7 +973,10 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin): ...@@ -973,7 +973,10 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin):
if len(inc_shape) == len(data_shape) and ( if len(inc_shape) == len(data_shape) and (
len(inc_shapes) == 0 or inc_shape[0] != 1): len(inc_shapes) == 0 or inc_shape[0] != 1):
inc_shape = (n_to_inc,) + inc_shape[1:] inc_shape = (n_to_inc,) + inc_shape[1:]
inc_size = numpy.product(inc_shape) # The param dtype is needed when inc_shape is empty.
# By default, it would return a float and rng.uniform
# with NumPy 1.10 will raise a Deprecation warning.
inc_size = numpy.product(inc_shape, dtype='int')
# Corresponding numeric variable. # Corresponding numeric variable.
inc_num = rng.uniform(size=inc_size).astype(self.dtype) inc_num = rng.uniform(size=inc_size).astype(self.dtype)
inc_num = inc_num.reshape(inc_shape) inc_num = inc_num.reshape(inc_shape)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论