You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
xreducer is not sharable despite being an xsharable_expression #2916
xreducer is an xsharable_expression, but attempting to call xt::make_xshared results in a compiler error because xreducer does not have the full interface expected by xshared_expression.
A simple example:
#include<xtensor/containers/xtensor.hpp>
#include<xtensor/generators/xrandom.hpp>intmain()
{
size_t n = 1000;
size_t m = 9;
size_t o = 12;
xt::xtensor<double, 3> tensor = xt::random::rand({n, m, o}, -20., 20.);
auto result = xt::make_xshared(xt::sum(tensor, {2}));
}
Whether you argue you should or shouldn't share a reducer, the end result in my opinion should not be for it to fail during instantiation of xshared_expression<xreducer<...>>. Reducer should either be stripped of its xsharable_expression-ness, the xshared_expression should include requires statements that disable unavailable methods, or xreducer should have its interface updated to include those currently non-extant methods.
Activity