-
Notifications
You must be signed in to change notification settings - Fork 412
Keep dims #1474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep dims #1474
Conversation
3a9827c
to
39440fc
Compare
8000
Oooooh I've been waiting on this one for awhile. Any advice on how to use it, for dummies? |
Here is a simple example: xt::xtensor<double, 4> a = xt::reshape_view(xt::arange<double>(5 * 5 * 5 * 5), {5, 5, 5, 5});
auto res = xt::sum(a, {0, 2}, xt::keep_dims | xt::evaluation_strategy::immediate | initial(5));
auto reso = xt::sum(a, {0, 2}, xt::keep_dims | xt::evaluation_strategy::immediate);
bool check = (res == reso); // check is true |
So it has to have an evaluation strategy to be able to specify |
There is an default evaluation strategy (lazy), you don't have to specify it:
Sorry for the confusion, it was a copy paste from a unit test. |
Just FYI, I just ran into this open numpy issue regarding adding keepdim to argmin. So it is something they have thought about! numpy/numpy#8710 |
No description provided.