提交 a4533f5b authored 作者: Adam Becker's avatar Adam Becker

mixed

- make tests faster - remove debug prints
上级 dfce51f6
...@@ -288,15 +288,13 @@ class Test_TopK(unittest.TestCase): ...@@ -288,15 +288,13 @@ class Test_TopK(unittest.TestCase):
idx = slice(-k, None) if k > 0 else slice(-k) idx = slice(-k, None) if k > 0 else slice(-k)
goal = np.sort(xval)[idx] goal = np.sort(xval)[idx]
print(np.sort(yval))
print(goal)
assert yval.dtype == goal.dtype assert yval.dtype == goal.dtype
assert utt.assert_allclose(np.sort(yval), goal) assert utt.assert_allclose(np.sort(yval), goal)
@utt.parameterized.expand(chain( @utt.parameterized.expand(chain(
product( product(
(16, 61, 257), (16, 61, 257),
(1, -1, 10, -10, 'n//2', 'n-1', '-n', '1-n'), (1, -1, -10, 'n//2', 'n-1', '-n'),
('float32', 'int32'), ('float32', 'int32'),
('int32', 'int64')), ('int32', 'int64')),
((2049, 1337, 'float32', 'int32'),))) ((2049, 1337, 'float32', 'int32'),)))
...@@ -319,7 +317,7 @@ class Test_TopK(unittest.TestCase): ...@@ -319,7 +317,7 @@ class Test_TopK(unittest.TestCase):
@utt.parameterized.expand(chain( @utt.parameterized.expand(chain(
product( product(
(16, 61, 257), (16, 61, 257),
(1, -1, 10, -10, 'n//2', 'n-1', '-n', '1-n'), (1, -1, 10, 'n//2', 'n-1', '1-n'),
('float32', 'int32'), ('float32', 'int32'),
('int32', 'int64')), ('int32', 'int64')),
((2049, 1337, 'float32', 'int32'),))) ((2049, 1337, 'float32', 'int32'),)))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论