Skip to content

Commit

Permalink
inner_strides_type imported in xstrided_view
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed Sep 12, 2018
1 parent 82eb410 commit 9900eeb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/xtensor/xstrided_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ namespace xt

using iterable_base = xiterable<self_type>;
using inner_shape_type = typename iterable_base::inner_shape_type;
using inner_strides_type = typename base_type::inner_strides_type;
using shape_type = typename base_type::shape_type;
using strides_type = typename base_type::strides_type;
using backstrides_type = typename base_type::backstrides_type;
Expand Down
10 changes: 10 additions & 0 deletions test/test_xview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1241,4 +1241,14 @@ namespace xt
EXPECT_EQ(view_assign_func(input, 4), 2 * exp1);
EXPECT_EQ(view_assign_func(input, 5), 2 * exp1);
}

TEST(xview, view_on_strided_view)
{
// Compilation test only
xt::xarray<float> original = xt::xarray<float>::from_shape({ 3, 2, 5 });
original.fill(float(0.));
auto str_view = xt::strided_view(original, { 1, xt::ellipsis() }); //i is an int
auto result = xt::view(str_view, xt::all(), xt::all());
EXPECT_EQ(result(0), 0.f);
}
}

0 comments on commit 9900eeb

Please sign in to comment.