@@ -964,27 +964,27 @@ cdef class usm_ndarray:
964964
965965 # if len(adv_ind == 1), the (only) element is always an array
966966 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
982982
983983 if any ((isinstance (ind, usm_ndarray) and ind.dtype == dpt_bool) for ind in adv_ind):
984984 adv_ind_int = list ()
985985 for ind in adv_ind:
986986 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))
988988 else :
989989 adv_ind_int.append(ind)
990990 res = _take_multi_index(res, tuple (adv_ind_int), adv_ind_start_p)
0 commit comments