Skip to content

Commit e8be790

Browse files
committed
Fix OpenVINO tensor iteration to prevent masking test hang
1 parent 17ca564 commit e8be790

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

keras/src/backend/openvino/core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,10 @@ def __len__(self):
499499
assert ov_shape[0].is_static, "the first dimension must be static"
500500
return ov_shape[0].get_length()
501501

502+
def __iter__(self):
503+
for index in range(len(self)):
504+
yield self[index]
505+
502506
def __bool__(self):
503507
return bool(self.numpy())
504508

0 commit comments

Comments
 (0)