Initial draft for a specialized computed_assign for xfixed by DerThorsten · Pull Request #2394 · xtensor-stack/xtensor
Initial draft for a specialized computed_assign for xfixed:
- added overload for fixed/nonfixed shape via enable_if
- added tests
Any broadcasting which would require a reshaping of the tensor we assign to will lead to an broadcast error.
But there is one thing where I do not know how to solve it:
Lets say a has a shape of (2,2) and b a shape of (1,2)
xt::xtensor_fixed<int, xt::xshape<2,2>> a = {{1,2},{3,4}}; xt::xarray<int> b = {{5,6}};
and I do
For such expressions, where broadcasting is involved to bring b to the correct shape, test suite only passes if I, within my implementation for computed_assign do this:
... base_type::assign_data(e1, e2, false/*trivial_broadcast*/); ...
If I set this to true, the test suite only passes for expression where no broadcasting is involved.
I am unsure how to figure out in a proper way from within computed_assign since the shape and dim of the expressions e1 and e2 are matching.