-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Typing of array operations #6173
Comments
I ended up doing something very similar for the LU and QR but hadn't seen the deep problem of non-existence of |
The trouble with using the first element is that it can give unexpected |
Hmm, an excellent point. Here's a fun one:
|
but the result of |
I should have clarified that this result is with current master, because of:
This is ultimately a consequence of
Presumably this could be fixed to return However, note another hazard with the
|
I think this is now fixed by our broadcast machinery? |
Illustrated with
SIUnits
, although this issue is not specific to that case:Fixing this seems a little delicate. For the functions here, I tested a solution that allocates the output in the following manner:
To try to avoid problems from when
one(T)
isn't defined, it uses the first element of the array and only falls back toone(T)
if the array is empty. That still leaves the possibility for error (and is therefore far from ideal), but it narrows the frequency with which it should happen.While this fixes this particular example, unfortunately it causes trouble for some of the
bitarray
tests:Not sure what folks think would be the right way forward here. I don't really see an ideal solution.
The text was updated successfully, but these errors were encountered: