Add section on copy-view behaviour and mutability#66
Conversation
|
two comments from sklearn: Basically we have a lot of iterative algorithms and we can often reuse arrays from previous algorithms, and sometimes we have temporaries that we can overwrite when applying unary transformations. Actually, looking into the repo, there's less places than I expected. We could probably use it in some other places as well. I wouldn't say it's a good pattern, but I don't know a way to replace it. The other thing that was mentioned by @rgommers was that it might be possible to have pools of memory to reuse. |
apaszke
left a comment
There was a problem hiding this comment.
It might be worth adding that there are libraries that do some form of tracing or abstract interpretation over a language that doesn't support mutation (to make analysis easier) and that in those cases implementing out= with correct handling of views might even be impossible to do.
Thanks @apaszke, I've added that sentence. I assume these libraries include both JAX and TensorFlow today? |
Glad to hear that:)
I think the "reusable buffers" feature could be used for the same thing in many cases, see example in data-apis/consortium-feedback#5. Where that's not the case is probably if you supply say a single row or column of an n-D array as the argument to |
Closes gh-24