-
Notifications
You must be signed in to change notification settings - Fork 2
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
scale!!(::SparseVector, ::SparseVector, x)
results in StackOverflowError
#19
Comments
Did some more experimentation. As can be seen from the error above the issue originates within
Looking at its code, it simply amounts to:
Now I am not sure why
Just works without error. So it might be that the somewhat non-standard wrapping of scalars into EDIT:
So perhaps one could interpret this |
I do think that if it works with |
I think I managed to reproduce the error without VectorInterface:
So I will open an issue with SparseArrays.jl. |
As an aside, I am always surprised seeing the use of |
Yes I agree. It came up for during some exploration with small vectors where I didn't pay attention to the concrete vector types. So no it is not a pressing issue for me by any means :) But it was quite confusing and did cost me a couple of minutes to find the error source. That's why I wanted to report it. Nonetheless, it might be beneficial to switch to |
Despite the error being in SparseArrays.jl, I think this problem should at least be fixed (circumvented) in VectorInterface 0.4.9 (just released). |
Feel free to reopen if the issue reappears. |
By chance I found that trying to use
KrylovKit.exponentiate
where the vector is aSparseArrays.SparseVector
results in aStackOverflowError
due to an endless recursive call. I tracked the error to a call ofscale!!(v1, v2, x)
where bothv1
andv2
areSparseArrays.SparseVector
s. It appears to be some unfortunate combination ofVectorInterface.jl
and broadcasting rules inSparseArrays.jl
that leads to the infinite recursion. I am totally unfamiliar withVectorInterface.jl
so I didn't attempt to search for a fix so far.MWE:
Stacktrace:
versioninfo
Pkg.status()
The text was updated successfully, but these errors were encountered: