-
Notifications
You must be signed in to change notification settings - Fork 421
Open
Description
Tested with last conan version 0.25.0
xt::xtensor<float, 2> arr1{{1.0, 2.0, 3.0}};
xt::xtensor<float, 1> arr2 = xt::squeeze(xt::view(arr1, xt::all(), xt::range(1, 3)));
Then arr2 = [1, 2] when the expected result would be [2, 3]
The problem does not occurs when assigning the view to a tensor before squeezing:
xt::xtensor<float, 2> arr3 = xt::view(arr1, xt::all(), xt::range(1, 3));
xt::xtensor<float, 1> arr4 = xt::squeeze(arr3);
Then arr4 = [2, 3]
The problem does not occur when using xt::keep instead of xt::range
xt::xtensor<float, 1> arr5 = xt::squeeze(xt::view(arr1, xt::all(), xt::keep(1, 2)));
Then arr5 = [2, 3]
Also the problem does not occur using numpy:
arr1 = np.array([[1, 2, 3]])
arr2 = np.squeeze(arr1[0, 1:3])
Then arr2 = [2, 3]
Note that we had a pretty serious hidden computation error from this issue.
Metadata
Metadata
Assignees
Labels
No labels