Closed hameerabbasi closed 5 years ago
Maybe errstate
& co, the set routines (unique in particular) and the sort routines? and np.pad
?
Updated the list. 😄
Question: Do we want to provide a default implementation?
Question: Do we want to provide a default implementation?
Depends on what that means I guess. I think it may be fine if
import unumpy as np
np.arange(5)
gives an error. However I think if you import one backend it should work with explicitly having to set the backend.
import unumpy as np
from unumpy.backends import XndBackend # or some such line
np.arange(5)
Or do you mean the order in which backends are chosen?
Ah, I mean (to be specific): Do we want a default implementation for MultiMethod
s in terms of others, if it is reasonably efficient?
That doesn't make it much clearer for me ..... Can you give a concrete example?
So, I currently dispatch sum
to add.reduce
with the appropriate arguments. Do we want to do something similar with some of these other functions?
Hmm, I'd guess not. The signatures in numpy for those two things don't even match, and other libraries may not match numpy. Why not leave that up to the backend?
To make it easier for the backend... And make gradual implementation easier while still having the option for a more complex or efficient one.
How many functions can this be done for? sum
, min
, max
, what else?
A lot of them, actually... nan
-reductions most of the time, usual reduction functions, stack
/concatenate
/block
, argwhere
/where
/nonzero
, etc.
To be clear, the backend can still override them. There will be a big bold disclaimer saying these can change.
Hmm yeah okay, I can see how that saves doing the exact same thing in multiple backends. So yes with a clear statement in the docs that this is done, why not?
Broadcasting and concat/stack done.
Searching and pad
done!
Closed this since everything here is done.
broadcast_arrays
/broadcast_to
(Quansight-Labs/uarray#150)concatenate
/stack
(Quansight-Labs/uarray#151)errstate
(#17)pad
(#12)unique
in1d
intersect1d
isin
setdiff1d
setxor1d
union1d
sort
(Quansight-Labs/uarray#145)lexsort
(Quansight-Labs/uarray#145)argsort
(Quansight-Labs/uarray#155)msort
(Quansight-Labs/uarray#155)sort_complex
(Quansight-Labs/uarray#155)partition
(Quansight-Labs/uarray#155)argpartition
(Quansight-Labs/uarray#155)argmax
nanargmax
(#10)argmin
nanargmin
(#10)argwhere
(#10)nonzero
(#10)flatnonzero
(#10)where
(#10)searchsorted
(#12)extract
(#12)count_nonzero
(#16)