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

replace size(A, d1, d2, ds...) with size(A, (dims...)) #26851

Closed
StefanKarpinski opened this issue Apr 19, 2018 · 4 comments
Closed

replace size(A, d1, d2, ds...) with size(A, (dims...)) #26851

StefanKarpinski opened this issue Apr 19, 2018 · 4 comments
Labels
arrays [a, r, r, a, y, s]
Milestone

Comments

@StefanKarpinski
Copy link
Member

Right now the general signature size(A, dims...) does different things depending on whether there are zero, one or many dimensions provided. It seems like it would be better to separate this into: no dimension argument, scalar dimension argument, and tuple dimension argument.

@StefanKarpinski StefanKarpinski added arrays [a, r, r, a, y, s] triage This should be discussed on a triage call labels Apr 19, 2018
@mbauman
Copy link
Member

mbauman commented Apr 19, 2018

Ah, so you'd want to still support size(A, 1) returning a single integer? Yes, that seems quite reasonable to me.

Note that the axes function doesn't support either varargs or tuples — it's either all or one. The two should probably match.

@StefanKarpinski
Copy link
Member Author

Yes, the proposal would be that these three forms are supported:

  1. size(A) --> (sizes[1], sizes[2], ...)
  2. size(A, d) --> sizes[d]
  3. size(A, (dims...)) --> (sizes[dims[1]], sizes[dims[2]], ...)

@StefanKarpinski
Copy link
Member Author

Or we could just deprecate it entirely...

@StefanKarpinski StefanKarpinski removed the triage This should be discussed on a triage call label Apr 19, 2018
@StefanKarpinski StefanKarpinski added this to the 1.0 milestone Apr 19, 2018
@mbauman
Copy link
Member

mbauman commented Apr 19, 2018

Supporting a tuple argument would be a bigger change. Many size methods don't constrain the dimension argument at all, and I think that's just fine.

This was only used within tests of size itself within the entire testsuite. I think we'll be just fine without it.

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

2 participants