Commit 8b210cbd authored by Philipp Arras's avatar Philipp Arras
Browse files

Add another type check

parent 4c644a96
...@@ -44,6 +44,8 @@ class ValueInserter(LinearOperator): ...@@ -44,6 +44,8 @@ class ValueInserter(LinearOperator):
for i, n in enumerate(index) for i, n in enumerate(index)
]): ]):
raise TypeError raise TypeError
if not len(index) == len(self.target.shape):
raise ValueError
self._index = index self._index = index
self._capability = self.TIMES | self.ADJOINT_TIMES self._capability = self.TIMES | self.ADJOINT_TIMES
# Check whether index is in bounds # Check whether index is in bounds
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment