We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 997f85b commit 3dc2d4cCopy full SHA for 3dc2d4c
1 file changed
backends/vulkan/utils.py
@@ -91,6 +91,8 @@ def __getitem__(self, idx: int) -> DtypeSet:
91
# Broadcasting: single set applies to all positions
92
if idx > 0 and len(self.vals) == 1:
93
return self.vals[0]
94
+ if idx >= len(self.vals):
95
+ return set()
96
return self.vals[idx]
97
98
def is_empty(self) -> bool:
@@ -1227,8 +1229,9 @@ def __len__(self):
1227
1229
def __getitem__(self, idx: int) -> TensorRepSet:
1228
1230
if idx > 0 and len(self) == 1:
1231
- else:
- return self.vals[idx]
1232
1233
1234
+ return self.vals[idx]
1235
1236
def __setitem__(self, idx: int, val: TensorRepSet) -> None:
1237
0 commit comments