-
Notifications
You must be signed in to change notification settings - Fork 4
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
Make nonzero
return Tensors
#55
Conversation
Is this the desired approach? I'm fine with this but I wonder if users would want a wrapped array when they call these destructuring operators. Usually they call this when the arrays are moving to a different library or framework. |
Hameer, you've been right before when it comes to conventions like this, so I'll defer to you here. This struck me as strange though since most of the time people call this when they "just want the data" |
Well, what I'd do is compute |
I wrapped it because |
Yes, we should definitely have "this library type" in/out. |
We already have |
Ah, I see. No worries, we can leave as is if the Array API requires it. Just thought I'd register that this is usually not what the user would expect from a function like this. A related function is "find". In Scipy, "find" does not return a tuple of |
I think most people will find themselves unwrapping the results of this function |
Maybe if |
Hi @hameerabbasi,
This is a small tweak to make sure
nonzero
returns Tensor's instead of NumPy arrays.