@@ -964,27 +964,27 @@ cdef class usm_ndarray:
964
964
965
965
# if len(adv_ind == 1), the (only) element is always an array
966
966
if len (adv_ind) == 1 and adv_ind[0 ].dtype == dpt_bool:
967
- key_ = adv_ind[0 ]
968
- adv_ind_end_p = key_.ndim + adv_ind_start_p
969
- if adv_ind_end_p > res.ndim:
970
- raise IndexError (" too many indices for the array" )
971
- key_shape = key_.shape
972
- arr_shape = res.shape[adv_ind_start_p:adv_ind_end_p]
973
- for i in range (key_.ndim):
974
- if matching:
975
- if not key_shape[i] == arr_shape[i] and key_shape[i] > 0 :
976
- matching = 0
977
- if not matching:
978
- raise IndexError (" boolean index did not match indexed array in dimensions" )
979
- res = _extract_impl(res, key_, axis = adv_ind_start_p)
980
- res.flags_ = _copy_writable(res.flags_, self .flags_)
981
- return res
967
+ key_ = adv_ind[0 ]
968
+ adv_ind_end_p = key_.ndim + adv_ind_start_p
969
+ if adv_ind_end_p > res.ndim:
970
+ raise IndexError (" too many indices for the array" )
971
+ key_shape = key_.shape
972
+ arr_shape = res.shape[adv_ind_start_p:adv_ind_end_p]
973
+ for i in range (key_.ndim):
974
+ if matching:
975
+ if not key_shape[i] == arr_shape[i] and key_shape[i] > 0 :
976
+ matching = 0
977
+ if not matching:
978
+ raise IndexError (" boolean index did not match indexed array in dimensions" )
979
+ res = _extract_impl(res, key_, axis = adv_ind_start_p)
980
+ res.flags_ = _copy_writable(res.flags_, self .flags_)
981
+ return res
982
982
983
983
if any ((isinstance (ind, usm_ndarray) and ind.dtype == dpt_bool) for ind in adv_ind):
984
984
adv_ind_int = list ()
985
985
for ind in adv_ind:
986
986
if isinstance (ind, usm_ndarray) and ind.dtype == dpt_bool:
987
- adv_ind_int.extend(_nonzero_impl(ind))
987
+ adv_ind_int.extend(_nonzero_impl(ind))
988
988
else :
989
989
adv_ind_int.append(ind)
990
990
res = _take_multi_index(res, tuple (adv_ind_int), adv_ind_start_p)
0 commit comments