Skip to content

Commit bf326d0

Browse files
authored
Merge pull request xtensor-stack#115 from JohanMabille/xtensor_012
moved to xtensor 0.12.0
2 parents 4b79e27 + 3fc6d84 commit bf326d0

File tree

7 files changed

+18
-14
lines changed

7 files changed

+18
-14
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ install:
2323
- conda update -q conda
2424
- conda info -a
2525
- conda install gtest cmake -c conda-forge
26-
- conda install xtensor==0.11.0 pytest numpy pybind11==2.1.1 -c conda-forge
26+
- conda install xtensor==0.12.0 pytest numpy pybind11==2.1.1 -c conda-forge
2727
- "set PYTHONHOME=%MINICONDA%"
2828
- cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=%MINICONDA%\\Library -D BUILD_TESTS=ON -D PYTHON_EXECUTABLE=%MINICONDA%\\python.exe .
2929
- nmake test_xtensor_python

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ install:
9595
- conda update -q conda
9696
# Useful for debugging any issues with conda
9797
- conda info -a
98-
- conda install xtensor==0.11.0 pytest numpy pybind11==2.1.1 -c conda-forge
98+
- conda install xtensor==0.12.0 pytest numpy pybind11==2.1.1 -c conda-forge
9999
- conda install cmake gtest -c conda-forge
100100
- cmake -D BUILD_TESTS=ON -D CMAKE_INSTALL_PREFIX=$HOME/miniconda .
101101
- make -j2 test_xtensor_python

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ from the `docs` subdirectory.
189189

190190
| `xtensor-python` | `xtensor` | `pybind11` |
191191
|-------------------|------------|-------------|
192-
| master | ^0.11.0 | ^2.1.0 |
192+
| master | ^0.12.0 | ^2.1.0 |
193193
| 0.13.x | ^0.11.0 | ^2.1.0 |
194194
| 0.12.x | ^0.10.2 | 2.1.\* |
195195
| 0.11.x | ^0.10.0 | 2.1.\* |

include/xtensor-python/pyarray.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ namespace xt
473473
: base_type()
474474
{
475475
// TODO: avoid allocation
476-
shape_type shape = make_sequence<shape_type>(0, size_type(1));
477-
strides_type strides = make_sequence<strides_type>(0, size_type(0));
476+
shape_type shape = xtl::make_sequence<shape_type>(0, size_type(1));
477+
strides_type strides = xtl::make_sequence<strides_type>(0, size_type(0));
478478
init_array(shape, strides);
479479
m_data[0] = T();
480480
}
@@ -661,8 +661,8 @@ namespace xt
661661
: base_type()
662662
{
663663
// TODO: prevent intermediary shape allocation
664-
shape_type shape = forward_sequence<shape_type>(e.derived_cast().shape());
665-
strides_type strides = make_sequence<strides_type>(shape.size(), size_type(0));
664+
shape_type shape = xtl::forward_sequence<shape_type>(e.derived_cast().shape());
665+
strides_type strides = xtl::make_sequence<strides_type>(shape.size(), size_type(0));
666666
compute_strides(shape, layout_type::row_major, strides);
667667
init_array(shape, strides);
668668
semantic_base::assign(e);

include/xtensor-python/pycontainer.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
#include "xtensor/xcontainer.hpp"
3030

31+
#include "xtl/xsequence.hpp"
32+
3133
namespace xt
3234
{
3335

@@ -233,7 +235,7 @@ namespace xt
233235
template <class D>
234236
inline void pycontainer<D>::reshape(const shape_type& shape, layout_type l)
235237
{
236-
strides_type strides = make_sequence<strides_type>(shape.size(), size_type(1));
238+
strides_type strides = xtl::make_sequence<strides_type>(shape.size(), size_type(1));
237239
compute_strides(shape, l, strides);
238240
reshape(shape, strides);
239241
}

include/xtensor-python/pytensor.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ namespace xt
224224
inline pytensor<T, N>::pytensor()
225225
: base_type()
226226
{
227-
m_shape = make_sequence<shape_type>(N, size_type(1));
228-
m_strides = make_sequence<strides_type>(N, size_type(0));
227+
m_shape = xtl::make_sequence<shape_type>(N, size_type(1));
228+
m_strides = xtl::make_sequence<strides_type>(N, size_type(0));
229229
init_tensor(m_shape, m_strides);
230230
m_data[0] = T();
231231
}
@@ -360,8 +360,8 @@ namespace xt
360360
inline pytensor<T, N>::pytensor(const xexpression<E>& e)
361361
: base_type()
362362
{
363-
shape_type shape = forward_sequence<shape_type>(e.derived_cast().shape());
364-
strides_type strides = make_sequence<strides_type>(N, size_type(0));
363+
shape_type shape = xtl::forward_sequence<shape_type>(e.derived_cast().shape());
364+
strides_type strides = xtl::make_sequence<strides_type>(N, size_type(0));
365365
compute_strides(shape, layout_type::row_major, strides);
366366
init_tensor(shape, strides);
367367
semantic_base::assign(e);

test/test_common.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include "xtensor/xlayout.hpp"
1313
#include "xtensor/xstridedview.hpp"
1414

15+
#include "xtl/xsequence.hpp"
16+
1517
namespace xt
1618
{
1719
template <class T, class A>
@@ -218,7 +220,7 @@ namespace xt
218220
using strides_type = typename V::strides_type;
219221
{
220222
SCOPED_TRACE("transpose");
221-
shape_type shape_new = xt::make_sequence<shape_type>(vec.dimension(), 0);
223+
shape_type shape_new = xtl::make_sequence<shape_type>(vec.dimension(), 0);
222224
std::copy(vec.shape().cbegin(), vec.shape().cend(), shape_new.begin());
223225
auto vt = transpose(vec);
224226
std::reverse(shape_new.begin(), shape_new.end());
@@ -268,7 +270,7 @@ namespace xt
268270

269271
auto vec_copy = vec;
270272

271-
shape_type a = xt::make_sequence<shape_type>(vec.dimension(), 0);
273+
shape_type a = xtl::make_sequence<shape_type>(vec.dimension(), 0);
272274
std::copy(vec.shape().cbegin(), vec.shape().cend(), a.begin());
273275
auto vt = transpose(vec, {1, 0, 2});
274276
shape_type shape_new = {a[1], a[0], a[2]};

0 commit comments

Comments
 (0)