xtensor-stack / xtensor-python

Python bindings for xtensor
BSD 3-Clause "New" or "Revised" License
351 stars 58 forks source link

Fixing constructor bug pytensor<..., 0> #263

Closed tdegeus closed 3 years ago

tdegeus commented 3 years ago

Fix of the following:

I am using a library that uses 'xscalar'. Now I'm wrapping with xtensor-python and am getting on Windows only:

pytensor.hpp(436,18): error C2466: cannot allocate an array of constant size 0
...
message : see reference to function template instantiation 'xt::pytensor<double,0,xt::layout_type::dynamic> xt::pytensor<double,0,xt::layout_type::dynamic>::from_shape<std::array<size_t,0>>(S &&)' being compiled with
[
    S=std::array<size_t,0>
]

Ref: https://github.com/tdegeus/GMatTensor/pull/29