diff --git a/.appveyor.yml b/.appveyor.yml index 3d9fbf7..5a99377 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -23,7 +23,7 @@ install: - conda update -q conda - conda info -a - conda install gtest cmake -c conda-forge - - conda install xtensor==0.11.0 pytest numpy pybind11==2.1.1 -c conda-forge + - conda install xtensor==0.12.0 pytest numpy pybind11==2.1.1 -c conda-forge - "set PYTHONHOME=%MINICONDA%" - cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=%MINICONDA%\\Library -D BUILD_TESTS=ON -D PYTHON_EXECUTABLE=%MINICONDA%\\python.exe . - nmake test_xtensor_python diff --git a/.travis.yml b/.travis.yml index 982b245..4ffec94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -95,7 +95,7 @@ install: - conda update -q conda # Useful for debugging any issues with conda - conda info -a - - conda install xtensor==0.11.0 pytest numpy pybind11==2.1.1 -c conda-forge + - conda install xtensor==0.12.0 pytest numpy pybind11==2.1.1 -c conda-forge - conda install cmake gtest -c conda-forge - cmake -D BUILD_TESTS=ON -D CMAKE_INSTALL_PREFIX=$HOME/miniconda . - make -j2 test_xtensor_python diff --git a/README.md b/README.md index 37bd3e7..9f58c5b 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ from the `docs` subdirectory. | `xtensor-python` | `xtensor` | `pybind11` | |-------------------|------------|-------------| -| master | ^0.11.0 | ^2.1.0 | +| master | ^0.12.0 | ^2.1.0 | | 0.13.x | ^0.11.0 | ^2.1.0 | | 0.12.x | ^0.10.2 | 2.1.\* | | 0.11.x | ^0.10.0 | 2.1.\* | diff --git a/include/xtensor-python/pyarray.hpp b/include/xtensor-python/pyarray.hpp index 85c37aa..1e33dfe 100644 --- a/include/xtensor-python/pyarray.hpp +++ b/include/xtensor-python/pyarray.hpp @@ -473,8 +473,8 @@ namespace xt : base_type() { // TODO: avoid allocation - shape_type shape = make_sequence(0, size_type(1)); - strides_type strides = make_sequence(0, size_type(0)); + shape_type shape = xtl::make_sequence(0, size_type(1)); + strides_type strides = xtl::make_sequence(0, size_type(0)); init_array(shape, strides); m_data[0] = T(); } @@ -661,8 +661,8 @@ namespace xt : base_type() { // TODO: prevent intermediary shape allocation - shape_type shape = forward_sequence(e.derived_cast().shape()); - strides_type strides = make_sequence(shape.size(), size_type(0)); + shape_type shape = xtl::forward_sequence(e.derived_cast().shape()); + strides_type strides = xtl::make_sequence(shape.size(), size_type(0)); compute_strides(shape, layout_type::row_major, strides); init_array(shape, strides); semantic_base::assign(e); diff --git a/include/xtensor-python/pycontainer.hpp b/include/xtensor-python/pycontainer.hpp index 5a19f2e..6c5d1f8 100644 --- a/include/xtensor-python/pycontainer.hpp +++ b/include/xtensor-python/pycontainer.hpp @@ -28,6 +28,8 @@ #include "xtensor/xcontainer.hpp" +#include "xtl/xsequence.hpp" + namespace xt { @@ -233,7 +235,7 @@ namespace xt template inline void pycontainer::reshape(const shape_type& shape, layout_type l) { - strides_type strides = make_sequence(shape.size(), size_type(1)); + strides_type strides = xtl::make_sequence(shape.size(), size_type(1)); compute_strides(shape, l, strides); reshape(shape, strides); } diff --git a/include/xtensor-python/pytensor.hpp b/include/xtensor-python/pytensor.hpp index 3ebcd34..a0107de 100644 --- a/include/xtensor-python/pytensor.hpp +++ b/include/xtensor-python/pytensor.hpp @@ -224,8 +224,8 @@ namespace xt inline pytensor::pytensor() : base_type() { - m_shape = make_sequence(N, size_type(1)); - m_strides = make_sequence(N, size_type(0)); + m_shape = xtl::make_sequence(N, size_type(1)); + m_strides = xtl::make_sequence(N, size_type(0)); init_tensor(m_shape, m_strides); m_data[0] = T(); } @@ -360,8 +360,8 @@ namespace xt inline pytensor::pytensor(const xexpression& e) : base_type() { - shape_type shape = forward_sequence(e.derived_cast().shape()); - strides_type strides = make_sequence(N, size_type(0)); + shape_type shape = xtl::forward_sequence(e.derived_cast().shape()); + strides_type strides = xtl::make_sequence(N, size_type(0)); compute_strides(shape, layout_type::row_major, strides); init_tensor(shape, strides); semantic_base::assign(e); diff --git a/test/test_common.hpp b/test/test_common.hpp index 01eb560..af775c7 100644 --- a/test/test_common.hpp +++ b/test/test_common.hpp @@ -12,6 +12,8 @@ #include "xtensor/xlayout.hpp" #include "xtensor/xstridedview.hpp" +#include "xtl/xsequence.hpp" + namespace xt { template @@ -218,7 +220,7 @@ namespace xt using strides_type = typename V::strides_type; { SCOPED_TRACE("transpose"); - shape_type shape_new = xt::make_sequence(vec.dimension(), 0); + shape_type shape_new = xtl::make_sequence(vec.dimension(), 0); std::copy(vec.shape().cbegin(), vec.shape().cend(), shape_new.begin()); auto vt = transpose(vec); std::reverse(shape_new.begin(), shape_new.end()); @@ -268,7 +270,7 @@ namespace xt auto vec_copy = vec; - shape_type a = xt::make_sequence(vec.dimension(), 0); + shape_type a = xtl::make_sequence(vec.dimension(), 0); std::copy(vec.shape().cbegin(), vec.shape().cend(), a.begin()); auto vt = transpose(vec, {1, 0, 2}); shape_type shape_new = {a[1], a[0], a[2]};