We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm expecting that the code below should work, but it doesn't compile.
int main(int argc, char** argv) { auto a = xt::arange(10); auto a_view = xt::reshape_view(a, {1, 5, 2}); auto b_view = xt::view(a_view, xt::all(), xt::range(3, 5), xt::all()); auto c_view = xt::view(a_view, xt::all(), xt::range(1, 3), xt::all()); c_view = b_view; return 0; }
The compilation error I'm getting:
examples/xtensor_main.cc:14:12: required from here bazel-out/k8-fastbuild/bin/external/xtensor/_virtual_includes/xtensor/xtensor/xstrided_view.hpp:478:16: error: no matching function for call to 'xt::xindexed_stepper<xt::xstrided_view<xt::xgenerator<xt::detail::arange_generator<int, int, int>, int, std::array<long unsigned int, 1> >&, std::array<long unsigned int, 3>, xt::layout_type::dynamic, xt::detail::flat_adaptor_getter<xt::xgenerator<xt::detail::arange_generator<int, int, int>, int, std::array<long unsigned int, 1> >&, xt::layout_type::row_major> >, false>::xindexed_stepper(xt::xstrided_view<xt::xgenerator<xt::detail::arange_generator<int, int, int>, int, std::array<long unsigned int, 1> >&, std::array<long unsigned int, 3>, xt::layout_type::dynamic, xt::detail::flat_adaptor_getter<xt::xgenerator<xt::detail::arange_generator<int, int, int>, int, std::array<long unsigned int, 1> >&, xt::layout_type::row_major> >*, xt::xstrided_view<xt::xgenerator<xt::detail::arange_generator<int, int, int>, int, std::array<long unsigned int, 1> >&, std::array<long unsigned int, 3>, xt::layout_type::dynamic, xt::detail::flat_adaptor_getter<xt::xgenerator<xt::detail::arange_generator<int, int, int>, int, std::array<long unsigned int, 1> >&, xt::layout_type::row_major> >::container_iterator, xt::xstrided_view<xt::xgenerator<xt::detail::arange_generator<int, int, int>, int, std::array<long unsigned int, 1> >&, std::array<long unsigned int, 3>, xt::layout_type::dynamic, xt::detail::flat_adaptor_getter<xt::xgenerator<xt::detail::arange_generator<int, int, int>, int, std::array<long unsigned int, 1> >&, xt::layout_type::row_major> >::size_type&)' 478 | return stepper(this, data_xbegin(), offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
Any ideas or temporary workarounds?
The text was updated successfully, but these errors were encountered:
As stated in https://xtensor.readthedocs.io/en/latest/builder.html#expression-builders, arange returns a lazy expression, holding no value. Therefore, you cannot assign to it, or to view on it, you need to evaluate it first:
arange
auto avalue = xt::eval(a_view). auto b_view = xt::view(avalue, xt::all(), xt::range(3, 5), xt::all()); auto c_view = xt::view(avalue, xt::all(), xt::range(1, 3), xt::all());
Sorry, something went wrong.
This issue is stale because it has been open for 30 days with no activity. It will be automatically closed in 14 days.
No branches or pull requests
I'm expecting that the code below should work, but it doesn't compile.
The compilation error I'm getting:
Any ideas or temporary workarounds?
The text was updated successfully, but these errors were encountered: