提交 e8a8b936 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Avoid int16 overflow on GPU in test

CPU wraps around, but GPU returns max_int16, so DebugMode was complaining.
上级 0582554d
......@@ -889,8 +889,10 @@ class T_reduce_dtype(unittest.TestCase):
(topo, output_dtype)
data = np.random.rand(3, 4) * 10
data = data.astype(input_dtype)
if output_dtype == 'float16' and method == 'prod':
if (method == 'prod' and output_dtype in
['float16', 'int8', 'uint8', 'int16', 'uint16']):
# We will likely get something infinite,
# or the overflow will be different between CPU and GPU,
# and DebugMode will complain.
data = data[0:1]
f(data)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论