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

improve code quality

- remove debug prints - use clear macro for 2^31-1 instead of hex
上级 5582a715
......@@ -208,10 +208,10 @@ class GpuTopKOp(GpuKernelBase, TopKOp):
PyExc_ValueError,
"topk: k cannot larger than size on specified axis %(axis)d");
%(fail)s;
} else if (dims[%(axis)d] > 0x7fffffffu) {
} else if (dims[%(axis)d] > INT_MAX) {
PyErr_SetString(
PyExc_ValueError,
"topk: on GPU, array size cannot larger or equal than 2^31");
"topk: on GPU, array size on specified axis cannot larger or equal than 2^31");
%(fail)s;
}
%(prep_output)s
......
......@@ -405,8 +405,6 @@ class Test_TopK(unittest.TestCase):
if k == 0:
continue
print('shape:', shp, 'k:', k, 'axis:', axis)
# make input away from undefined gradient (where some inputs are equal)
xval = gen_unique_vector(
reduce(int.__mul__, shp),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论