Skip to content

Commit e32175a

Browse files
[OpenVINO backend] add a check for getitem (#21407)
1 parent 157f653 commit e32175a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

keras/src/backend/openvino/core.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,13 @@ def count_unsqueeze_before(dim):
341341
raise ValueError(
342342
"OpenVINO backend does not support boolean indexing"
343343
)
344-
elif isinstance(index, (int, np.integer)):
345-
if isinstance(index, np.integer):
344+
elif isinstance(index, (int, np.integer, np.ndarray)):
345+
if isinstance(index, (np.ndarray, np.integer)):
346+
if isinstance(index, np.ndarray) and len(index.shape) != 0:
347+
raise ValueError(
348+
"OpenVINO backend does not support"
349+
"multi-dimensional indexing"
350+
)
346351
index = int(index)
347352
actual_dim = dim - count_unsqueeze_before(dim)
348353
if not (0 <= actual_dim < rank):

0 commit comments

Comments
 (0)