Skip to content

Commit 7e08f7c

Browse files
committed
Simplify _build_choices_list
1 parent 2590ca1 commit 7e08f7c

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

dpnp/dpnp_iface_indexing.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,10 @@ def _build_choices_list(choices):
130130
"""
131131

132132
if dpnp.is_supported_array_type(choices):
133-
choices = [dpnp.get_usm_ndarray(chc) for chc in dpnp.unstack(choices)]
134-
elif isinstance(choices, Iterable):
135-
choices_ = []
136-
for chc in choices:
137-
chc_ = dpnp.get_usm_ndarray(chc)
138-
choices_.append(chc_)
139-
choices = choices_
140-
else:
133+
choices = dpnp.unstack(choices)
134+
elif not isinstance(choices, Iterable):
141135
raise TypeError("`choices` must be an array or sequence of arrays")
142-
143-
return choices
136+
return [dpnp.get_usm_ndarray(chc) for chc in choices]
144137

145138

146139
def _choose_run(inds, chcs, q, usm_type, out=None, mode=0):

0 commit comments

Comments
 (0)