Skip to content

reduce and reducedim have inconsistent signature #23064

@wsshin

Description

@wsshin

Currently (in v0.7) reduce's signature is reduce(op, itr) and reduce(op, v0, itr), whereas reducedim's signature is reducedim(f, A, region[, v0]). It was surprising to me that the order of v0 is inconsistent between the two functions.

It is understandable that v0 comes earlier than itr in reduce(op, v0, itr), because v0 is the left argument of the binary operator op and itr supplies right arguments. To be consistent, wouldn't it be better to separate the definition reducedim(f, A, region[, v0]) into two: reducedim(f, A, region) and reducedim(f, v0, A, region)? Or, is there any particular reason for this inconsistency?

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions