Replace use of shaped_sparse_random with shaped_random
@@ -295,9 +295,9 @@ class TestMaskIndices:
@testing.numpy_cupy_array_equal()
def test_mask_indices(self, xp):
- arr = testing.shaped_sparse_random((10, 10), density=0.5).todense()
- if xp is numpy:
- arr = cupy.asnumpy(arr)
+ # arr is a square matrix with 50% density
+ multiplier = testing.shaped_random((10, 10), xp=xp, dtype=xp.bool_)
+ arr = testing.shaped_random((10, 10), xp=xp) * multiplier
return xp.mask_indices(10, lambda n, k=None: arr)
@testing.numpy_cupy_array_equal()
