-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[WIP] constructors for Array from zeros/ones #24389
Conversation
Wasn't the idea to have |
Yes, that's roughly the idea :). Establishing a beachhead to explore this direction for |
I think we might want to generalize "possibly shapeless iterator" to "thing that provides a mapping from indices to values", which includes iterators as a special case where the indices are implied by counting as iteration happens. In this case the |
Through working with |
We have to be careful with that. For example, if an index-less iterator is taken too seriously to have indices 1:n, it would not initialize an OffsetArray with indices -n:-1. |
Ref. the last paragraph in #11557 (comment) :). |
Closing for the reasons given in #24595. Thanks all! |
This pull request provides constructors for
Array
fromzeros
/ones
, for exampleArray(zeros, dims)
andVector{T}(ones, n)
. In other words, this pull request explores #11557 (comment). Best!