Open
Description
Take a look at this example:
std::array shape{3, 4, 5};
auto shape_adapt = xt::adapt(shape);
auto tensor = xt::eval(2 * shape_adapt);
The resulting type of tensor
is xtensor_container
, which is vector
underneath. So we went from array
to vector
.
This is a very common use case for working with tensor shapes and would optimize quite a bit. Currently we go for std::transform
and xtl::make_sequence
in these cases, which is not so nice. Adapting shapes would be much nicer))