Open
Description
Hey,
I have tested some code with xt::mean, and find it very slow than numpy with hundreds of times difference. The data is a 2-d array.
xtensor version
xt::pyarray<double> mean(xt::pyarray<double> &data)
{
int samples_num = data.shape(1);
int channels_num = data.shape(0);
for(int i=0; i<channels_num; i++)
{
auto dd = xt::view(data, i, xt::all());
auto trend = xt::mean(dd);
xt::view(data, i, xt::all()) -= trend;
}
return data;
}
numpy version
data -= np.mean(data)
Does anybody know what is wrong with my code? I use m1-max, clang++ compiler.