Skip to content

Commit fbefa53

Browse files
committed
limit the range of random int
Signed-off-by: Lu,Chengjun <[email protected]>
1 parent 9004c76 commit fbefa53

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/test/unit/language/test_core.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2534,7 +2534,12 @@ def kernel(X, Z, BLOCK: tl.constexpr):
25342534
# input
25352535
rs = RandomState(17)
25362536
# limit the range of integers so that the sum does not overflow
2537-
x = numpy_random((shape, ), dtype_str=dtype_str, rs=rs)
2537+
if dtype_str in integral_dtypes:
2538+
low = 0 if dtype_str in uint_dtypes else -100
2539+
high = 100
2540+
x = numpy_random((shape, ), dtype_str=dtype_str, rs=rs, low=low, high=high)
2541+
else:
2542+
x = numpy_random((shape, ), dtype_str=dtype_str, rs=rs)
25382543
numpy_op = {
25392544
'sum': np.sum,
25402545
'max': np.max,

0 commit comments

Comments
 (0)