提交 ea26ad22 authored 作者: Frederic Bastien's avatar Frederic Bastien

Test neg values and higher values

上级 e74d74c0
...@@ -3092,7 +3092,8 @@ class T_max_and_argmax(unittest.TestCase): ...@@ -3092,7 +3092,8 @@ class T_max_and_argmax(unittest.TestCase):
assert tuple(v_shape) == np.max(data, np_axis).shape assert tuple(v_shape) == np.max(data, np_axis).shape
def test2_float16(self): def test2_float16(self):
data = rand(2, 3).astype("float16") # Test negative values and bigger range to make sure numpy don't do the argmax as on uint16
data = (rand(20, 30).astype("float16")-0.5)*20
n = shared(data) n = shared(data)
for (axis, np_axis) in [(-1, -1), (0, 0), (1, 1), (None, None), for (axis, np_axis) in [(-1, -1), (0, 0), (1, 1), (None, None),
([0, 1], None), ([1, 0], None), ([0, 1], None), ([1, 0], None),
...@@ -3321,7 +3322,8 @@ class T_argmin_argmax(unittest.TestCase): ...@@ -3321,7 +3322,8 @@ class T_argmin_argmax(unittest.TestCase):
assert tuple(v_shape) == nfct(data, np_axis).shape assert tuple(v_shape) == nfct(data, np_axis).shape
def test2_float16(self): def test2_float16(self):
data = rand(2, 3).astype("float16") # Test negative values and bigger range to make sure numpy don't do the argmax as on uint16
data = (rand(20, 30).astype("float16")-0.5)*20
n = shared(data) n = shared(data)
mode = get_default_mode().including("local_max_and_argmax", "uncanonicalize") mode = get_default_mode().including("local_max_and_argmax", "uncanonicalize")
for fct, nfct in [(argmax, np.argmax), (argmin, np.argmin)]: for fct, nfct in [(argmax, np.argmax), (argmin, np.argmin)]:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论