xtensor icon indicating copy to clipboard operation
xtensor copied to clipboard

xmasked_view is error

Open jiapengwen opened this issue 2 years ago • 1 comments

code

xt::xarray<double> a = {{1, 5, 3}, {4, 5, 6}};
xt::xarray<bool> mask = {{true, false, false}, {false, true, false}};
auto m = xt::masked_view(a, mask);
// => m = {{1, masked, masked}, {masked, 5, masked}}
cout << m << endl;
m += 100;
// => a = {{101, 5, 3}, {4, 105, 6}}
cout << a << endl;

answer

{{masked, masked, masked},
{masked, masked, masked}}
{{ 101., 5., 3.},
{ 4., 105., 6.}}

obvious, the answer is not the same with doc in code

jiapengwen avatar Mar 16 '22 08:03 jiapengwen

has this bug been solved?

yysu-888 avatar Apr 21 '22 02:04 yysu-888