Adding `writeable` to `flags`
See original GitHub issueNumPy arrays have the writeable
option in flags
. This can be useful for checking to see if one can write to an array or not. Also it can be useful to ensure an array is not written to (by setting this flag to False
). Would be useful to have this flag on CuPy arrays as well.
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (13 by maintainers)
Top Results From Across the Web
post it flags writable - Amazon.com
Amazon.com: post it flags writable. ... RESULTS. Amazon's Choice. Post-it Memo Flags, 60 Count, 1 in Wide, Assorted Bright Colors. Pinch to zoom-in...
Read more >numpy.ndarray.flags — NumPy v1.24 Manual
The flags object can be accessed dictionary-like (as in a.flags['WRITEABLE'] ), or by using lowercased attribute names (as in a.flags.writeable ).
Read more >Property flags and descriptors - The Modern JavaScript Tutorial
Returns true if adding/removing/changing properties is forbidden, and all current properties are configurable: false, writable: false . These ...
Read more >Why configurable:false allows to change writable flag but does ...
Why did the writable flag change without throwing any error. Because the specification allows changing the writable flag on a data property ...
Read more >Stalogy 012 Writeable Page Flags - Tokyo Pen Shop
Long adhesive area prevents flags from falling off surfaces. Pigmented, yet transparent, allowing for ... Stalogy 012 Writeable Page Flags ... Add to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think what @kmaehashi meant is that it is hard to respect that flag in almost all basic CuPy operations except in
ElementwiseKernel
/ReductionKernel
, where the input/output array attributes are put into inspection before processing.I think this puts an extra layer of burden in general across all Python GPU libraries. Note that Numba does not respect that flag either. @jakirkham, could you point us to examples where (and how) this is implemented?
Right the interest here would be to mark arrays as read-only. 🙂
Yeah NumPy honors this at the C level as well. It does bit masking against the flags (an
int
) to check. Only operations that are manipulating the data itself.I’m not sure. Would think
__setitem__
and the inplace math operations would be the main issues. Are there other cases outside of these that would manipulate data in CuPy? You know the code here better than I. 😉That seems like a useful feature to include. Though agree it is a different concern.