@@ -57,12 +57,15 @@ The situation with `out=` is slightly different - it's less heavily used, and
57
57
easier to avoid. It's also not an optimal API, because it mixes an
58
58
"efficiency of implementation" consideration ("you're allowed to do this
59
59
inplace") with the semantics of a function ("the output _ must_ be placed into
60
- this array). There's alternatives, for example the donated arguments in JAX
61
- or working buffers in LAPACK, that allow the user to express "you _ may_
62
- overwrite this data, do whatever is fastest". Given that those alternatives
63
- aren't widely used in array libraries today, this API standard chooses to (a)
64
- leave out ` out= ` , and (b) not specify another method of reusing arrays that
65
- are no longer needed as buffers.
60
+ this array). There are libraries that do some form of tracing or abstract
61
+ interpretation over a language that does not support mutation (to make
62
+ analysis easier); in those cases implementing ` out= ` with correct handling of
63
+ views may even be impossible to do. There's alternatives, for example the
64
+ donated arguments in JAX or working buffers in LAPACK, that allow the user to
65
+ express "you _ may_ overwrite this data, do whatever is fastest". Given that
66
+ those alternatives aren't widely used in array libraries today, this API
67
+ standard chooses to (a) leave out ` out= ` , and (b) not specify another method
68
+ of reusing arrays that are no longer needed as buffers.
66
69
67
70
This leaves the problem of the initial example - with this API standard it
68
71
remains possible to write code that will not work the same for all array
0 commit comments