@@ -473,7 +473,7 @@ def test_input_1d(self, a_dt, indices, ind_dt, ivals, mode):
473473 b .put (ind , vals , mode = mode )
474474 ib .put (iind , ivals , mode = mode )
475475 assert_array_equal (ib , b )
476- elif numpy . issubdtype ( ind_dt , numpy .uint64 ) :
476+ elif ind_dt == numpy .uint64 :
477477 # For this special case, NumPy raises an error but dpnp works
478478 assert_raises (TypeError , numpy .put , a , ind , vals , mode = mode )
479479 assert_raises (TypeError , b .put , ind , vals , mode = mode )
@@ -508,7 +508,7 @@ def test_input_2d(self, a_dt, indices, ind_dt, mode):
508508 ind = get_abs_array (indices , ind_dt )
509509 iind = dpnp .array (ind )
510510
511- if numpy . issubdtype ( ind_dt , numpy .uint64 ) :
511+ if ind_dt == numpy .uint64 :
512512 # For this special case, NumPy raises an error but dpnp works
513513 assert_raises (TypeError , numpy .put , a , ind , vals , mode = mode )
514514
@@ -656,7 +656,7 @@ def test_broadcast(self, arr_dt, idx_dt):
656656 ind = numpy .arange (10 , dtype = idx_dt ).reshape ((1 , 2 , 5 )) % 4
657657 ia , iind = dpnp .array (a ), dpnp .array (ind )
658658
659- if numpy . issubdtype ( idx_dt , numpy .uint64 ) :
659+ if idx_dt == numpy .uint64 :
660660 numpy .put_along_axis (a , ind , 20 , axis = 1 )
661661 dpnp .put_along_axis (ia , iind , 20 , axis = 1 )
662662 assert_array_equal (ia , a )
@@ -701,7 +701,7 @@ def test_1d(self, a_dt, ind_dt, indices, mode):
701701 result = dpnp .take (ia , iind , mode = mode )
702702 expected = numpy .take (a , ind , mode = mode )
703703 assert_array_equal (result , expected )
704- elif numpy . issubdtype ( ind_dt , numpy .uint64 ) :
704+ elif ind_dt == numpy .uint64 :
705705 # For this special case, although casting `ind_dt` to numpy.intp
706706 # is not safe, both NumPy and dpnp work properly
707707 # NumPy < "2.2.0" raises an error
@@ -726,7 +726,7 @@ def test_2d(self, a_dt, ind_dt, indices, mode, axis):
726726 ind = get_abs_array (indices , ind_dt )
727727 ia , iind = dpnp .array (a ), dpnp .array (ind )
728728
729- if numpy . issubdtype ( ind_dt , numpy .uint64 ) :
729+ if ind_dt == numpy .uint64 :
730730 # For this special case, NumPy raises an error on Windows
731731 result = ia .take (iind , axis = axis , mode = mode )
732732 expected = a .take (ind .astype (numpy .int64 ), axis = axis , mode = mode )
@@ -1461,6 +1461,16 @@ def test_choose_inds_all_dtypes(self, dtype):
14611461 chcs = dpnp .ones (1 , dtype = dtype )
14621462 with pytest .raises (TypeError ):
14631463 dpnp .choose (inds , chcs )
1464+ elif dtype == numpy .uint64 :
1465+ # For this special case, NumPy raises an error but dpnp works
1466+ inds_np = numpy .array ([1 , 0 , 1 ], dtype = dtype )
1467+ inds = dpnp .array (inds_np )
1468+ chcs_np = numpy .array ([1 , 2 , 3 ], dtype = dtype )
1469+ chcs = dpnp .array (chcs_np )
1470+ assert_raises (TypeError , numpy .choose , inds_np , chcs_np )
1471+ expected = numpy .choose (inds_np .astype (numpy .int64 ), chcs_np )
1472+ result = dpnp .choose (inds , chcs )
1473+ assert_array_equal (expected , result )
14641474 else :
14651475 inds_np = numpy .array ([1 , 0 , 1 ], dtype = dtype )
14661476 inds = dpnp .array (inds_np )
0 commit comments