Skip to content

Commit 73d720e

Browse files
committed
Simplify shaped_random for bool case
1 parent c15d8c6 commit 73d720e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cupy/testing/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ def shaped_random(shape, xp=cupy, dtype=numpy.float32, scale=10, seed=0):
11421142
numpy.random.seed(seed)
11431143
dtype = numpy.dtype(dtype)
11441144
if dtype == '?':
1145-
return xp.asarray(numpy.random.randint(2, size=shape).astype(dtype))
1145+
return xp.asarray(numpy.random.randint(2, size=shape), dtype=dtype)
11461146
elif dtype.kind == 'c':
11471147
a = numpy.random.rand(*shape) + 1j * numpy.random.rand(*shape)
11481148
return xp.asarray(a * scale, dtype=dtype)

0 commit comments

Comments
 (0)