Skip to content
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

reduce and reducedim have inconsistent signature #23064

Closed
wsshin opened this issue Aug 1, 2017 · 3 comments
Closed

reduce and reducedim have inconsistent signature #23064

wsshin opened this issue Aug 1, 2017 · 3 comments
Labels
arrays [a, r, r, a, y, s]

Comments

@wsshin
Copy link
Contributor

wsshin commented Aug 1, 2017

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?

@JeffBezanson JeffBezanson added the arrays [a, r, r, a, y, s] label Aug 1, 2017
@StefanKarpinski
Copy link
Sponsor Member

They should definitely be made to match. @simonbyrne has an idea of introducing a Slices type that might help refactor this.

@nalimilan
Copy link
Member

#27711 will fix this. Cc: @andyferris

@nalimilan
Copy link
Member

Actually it's already fixed since reducedim has been merged with reduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s]
Projects
None yet
Development

No branches or pull requests

4 participants