Commit 5a767186 authored by Gordian Edenhofer's avatar Gordian Edenhofer
Browse files Fix equal shape slicing

Allow the SliceOperator to handle a new shape which equals the old
parent 7be2eb8f
Pipeline #95737 passed with stages
in 11 minutes and 41 seconds
......@@ -65,9 +65,11 @@ class SliceOperator(LinearOperator):
tgt = []
slc_by_ax = []
for i, d in enumerate(self._domain):
if new_shape[i] is None or self._domain.shape[i] == new_shape[i]:
if new_shape[i] is None or np.all(
np.array(self._domain.shape[i]) == np.array(new_shape[i])
tgt += [d]
elif np.all(np.array(new_shape[i]) < np.array(d.shape)):
elif np.all(np.array(new_shape[i]) <= np.array(d.shape)):
dom_kw = dict()
if isinstance(d, RGSpace):
if preserve_dist:
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