Skip to content

keep_dims for reducers #1130

@wolfv

Description

@wolfv

While implementing std and var we need to use a reducer-in-a-reducer that is multiplied with something -- so keep_dims is necessary for successful broadcasting.

Since keep_dims would modify the return type of the reducer for fixed_shape and static dimensioned arguments, we need to have this as a template argument.

One idea would be to make the evaluation strategy somewhat composable. I am currently thinking of this syntax:

sum(a, keep_dims() | evaluation_strategy::immediate())

This would be deduced into an object that carries template arguments for evaluation strategy, keep dims (and potential other compile time args we want to supply).

I guess we could also overload the comma operator but that would be a bit crazy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions