Skip to content

Commit bc13355

Browse files
committed
Allow any Iterable object when building choices list
1 parent 938a184 commit bc13355

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dpnp/dpnp_iface_indexing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
# pylint: disable=protected-access
4141

4242
import operator
43+
from collections.abc import Iterable
4344

4445
import dpctl.tensor as dpt
4546
import dpctl.tensor._tensor_impl as ti
@@ -130,7 +131,7 @@ def _build_choices_list(choices):
130131

131132
if dpnp.is_supported_array_type(choices):
132133
choices = [dpnp.get_usm_ndarray(chc) for chc in dpnp.unstack(choices)]
133-
elif isinstance(choices, (tuple, list)):
134+
elif isinstance(choices, Iterable):
134135
choices_ = []
135136
for chc in choices:
136137
chc_ = dpnp.get_usm_ndarray(chc)

0 commit comments

Comments
 (0)