-
-
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
wrap
is a very generic name to export
#53552
Comments
I feel like I remember some reason why we didn't want to do I also think though that wrap(the_type, the_object, [the_size]) I guess I also just like the symmetry because it really is basically the same thing as |
Most of the definitions of |
Adding triage label per @jariji's request in the #triage slack channel |
From triage, for 1.11, we should delete wrap (replace current usages with view)
View supports preallocating for an empty Vector Other options we didn't like
|
See also |
- Make reshape and view with one based indexing on Memory produce Arrays - delete wrap Implements #53552 (comment) --------- Co-authored-by: Jameson Nash <[email protected]>
For posteriority, what was the reasoning for having |
The primary reasoning is that we somewhat bacronymmed this. The thing we wanted was a way to construct an Array from a memory with specific bounds, and we realized that view has the right semantics. |
- Make reshape and view with one based indexing on Memory produce Arrays - delete wrap Implements #53552 (comment) --------- Co-authored-by: Jameson Nash <[email protected]> (cherry picked from commit 273d91e)
wrap
was introduced as the safe alternative tounsafe_wrap
in #52049 in December by @MasonProtter.Maybe this is the right call but I want to at least flag the issue.
wrap
a very a generic name and there are many packages using it for all kinds of purposes, and many others that will likely want to choose that name in the future. 288 files on GitHub definewrap
, with some duplicates.Options:
Package.wrap
instead ofusing
packages. Many people who would write a functionwrap
will probably decide to choose a different name for their function. Heavy users ofBase.wrap
will be pleased.wrap
. Users will writeBase.wrap
instead ofwrap
, which could be annoying if it's in common usage, but will be more pleasant for authors and users of other functions namedwrap
.wrap_memory
?Array
?array
?memoryarray
? something else?The text was updated successfully, but these errors were encountered: