Skip to content

Commit dc6ad70

Browse files
authored
Merge pull request #184 from wolfv/update_xtl
fix forward_shape
2 parents f0fc08f + 0f63a89 commit dc6ad70

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

include/xtensor-python/pyarray.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ namespace xt
624624
template <class S>
625625
inline pyarray<T, L> pyarray<T, L>::from_shape(S&& shape)
626626
{
627-
auto shp = xtl::forward_sequence<shape_type>(shape);
627+
auto shp = xtl::forward_sequence<shape_type, S>(shape);
628628
return self_type(shp);
629629
}
630630
//@}
@@ -679,7 +679,7 @@ namespace xt
679679
: base_type()
680680
{
681681
// TODO: prevent intermediary shape allocation
682-
shape_type shape = xtl::forward_sequence<shape_type>(e.derived_cast().shape());
682+
shape_type shape = xtl::forward_sequence<shape_type, decltype(e.derived_cast().shape())>(e.derived_cast().shape());
683683
strides_type strides = xtl::make_sequence<strides_type>(shape.size(), size_type(0));
684684
compute_strides(shape, layout_type::row_major, strides);
685685
init_array(shape, strides);

include/xtensor-python/pycontainer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ namespace xt
378378
inline void pycontainer<D>::resize(const S& shape, const strides_type& strides)
379379
{
380380
detail::check_dims<shape_type>::run(shape.size());
381-
derived_type tmp(xtl::forward_sequence<shape_type>(shape), strides);
381+
derived_type tmp(xtl::forward_sequence<shape_type, decltype(shape)>(shape), strides);
382382
*static_cast<derived_type*>(this) = std::move(tmp);
383383
}
384384

include/xtensor-python/pytensor.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ namespace xt
334334
inline pytensor<T, N, L> pytensor<T, N, L>::from_shape(S&& shape)
335335
{
336336
detail::check_dims<shape_type>::run(shape.size());
337-
auto shp = xtl::forward_sequence<shape_type>(shape);
337+
auto shp = xtl::forward_sequence<shape_type, S>(shape);
338338
return self_type(shp);
339339
}
340340
//@}
@@ -378,7 +378,7 @@ namespace xt
378378
inline pytensor<T, N, L>::pytensor(const xexpression<E>& e)
379379
: base_type()
380380
{
381-
shape_type shape = xtl::forward_sequence<shape_type>(e.derived_cast().shape());
381+
shape_type shape = xtl::forward_sequence<shape_type, decltype(e.derived_cast().shape())>(e.derived_cast().shape());
382382
strides_type strides = xtl::make_sequence<strides_type>(N, size_type(0));
383383
compute_strides(shape, layout_type::row_major, strides);
384384
init_tensor(shape, strides);

0 commit comments

Comments
 (0)