@@ -3480,24 +3480,23 @@ def test_reverse():
3480
3480
@with_seed ()
3481
3481
def test_tile ():
3482
3482
def test_normal_case ():
3483
- ndim_max = 3 # max number of dims of the ndarray
3484
- size_max = 10 # max number of elements in each dim
3485
- length_max = 3 # max length of reps
3486
- rep_max = 10 # max number of tiling in each dim
3487
- for ndim in range (ndim_max , ndim_max + 1 ):
3488
- shape = ()
3489
- for i in range (0 , ndim ):
3490
- shape += (np .random .randint (1 , size_max + 1 ), )
3483
+ ndim_min = 1
3484
+ ndim_max = 5 # max number of dims of the ndarray
3485
+ size_max = 10 # max number of elements in each dim
3486
+ length_max = 3 # max length of reps
3487
+ rep_max = 10 # max number of tiling in each dim
3488
+ for ndim in range (ndim_min , ndim_max + 1 ):
3489
+ shape = []
3490
+ for i in range (1 , ndim + 1 ):
3491
+ shape .append (np .random .randint (1 , size_max + 1 ))
3492
+ shape = tuple (shape )
3491
3493
a = np .random .randint (0 , 100 , shape )
3492
- a = np .asarray (a , dtype = np .int32 )
3493
- if ndim == 0 :
3494
- a = np .array ([])
3495
- b = mx .nd .array (a , ctx = default_context (), dtype = a .dtype )
3494
+ b = mx .nd .array (a , dtype = a .dtype )
3496
3495
3497
- reps_len = np .random .randint (0 , length_max + 1 )
3496
+ reps_len = np .random .randint (1 , length_max + 1 )
3498
3497
reps_tuple = ()
3499
3498
for i in range (1 , reps_len ):
3500
- reps_tuple += (np .random .randint (0 , rep_max ), )
3499
+ reps_tuple += (np .random .randint (1 , rep_max ), )
3501
3500
reps_array = np .asarray (reps_tuple )
3502
3501
3503
3502
a_tiled = np .tile (a , reps_array )
0 commit comments