-
Notifications
You must be signed in to change notification settings - Fork 417
reducer: add keep dims option #1312
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
Conversation
2e36570
to
6ee8d78
Compare
b34cad8
to
98b0e55
Compare
c105445
to
2617025
Compare
@JohanMabille can we merge this one for the 0.20 branch!? |
{ | ||
}; | ||
|
||
struct _immediate : xt::detail::option_base {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
names starting with _
are reserved for the standard. This could be replaced with immediate_t
for instance.
|
||
template <class ST, class X> | ||
struct xreducer_shape_type; | ||
struct _keep_dims : xt::detail::option_base {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same remarke regarding the name starting with _
.
inline void shape_computation(RS& result_shape, R& result, E& expr, | ||
const AX& axes, std::enable_if_t<!detail::is_fixed<RS>::value, int> = 0) | ||
{ | ||
if (KD()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit weird to mix std::false_type
with reducer options unrelated to boolean constants (and rely on their conversion to bool). Besides, this is true for any value of KD
that do not implement a boolean conversion operator returning false. If the KD
template parameter cannot be changed for a bool compile-time value, a static constexpr function comparing KD with keep_dims
option would be more expressive.
4114767
to
7adb4e8
Compare
Superseded by #1474 |
No description provided.