diff --git a/gem/interpreter.py b/gem/interpreter.py index a7e2e724..a95c3d9b 100644 --- a/gem/interpreter.py +++ b/gem/interpreter.py @@ -60,7 +60,7 @@ def filter(self, idx, fids): return tuple(idx[fids.index(i)] for i in self.fids) + idx[len(fids):] def __getitem__(self, idx): - return self.arr[idx] + return self.arr[tuple(idx)] def __setitem__(self, idx, val): self.arr[idx] = val diff --git a/tsfc/tensor.py b/tsfc/tensor.py index d4f80fa0..8902b470 100644 --- a/tsfc/tensor.py +++ b/tsfc/tensor.py @@ -31,7 +31,7 @@ def einsum(factors, sum_indices): else: selectors.append(slice(None)) letters.append(index2letter[index]) - operands.append(literal.array.__getitem__(selectors)) + operands.append(literal.array.__getitem__(tuple(selectors))) subscript_parts.append(''.join(letters)) result_pairs = sorted((letter, index)