-
Notifications
You must be signed in to change notification settings - Fork 9
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
size() returns Tuple of Tuples instead of Tuple #25
Comments
Hi, yes as far as I remember in this package Instead of overriding the functions I suspect it would be easier to create a function in Alternatively you could modify the function
but I think that might break some code in here, so it might be a time consuming change. |
Thank you for the quick and detailed answer! Is it usual practice to have size() return a Tuple of Tuples in the case of tensors? I am not familiar enough with the Julia ecosystem to tell. Should I open an issue on Krylov.jl instead? I was thrilled to be able to just plug in AbstractOperators.Conv to a Krylov.jl solver. The override of size() is just a minor wrinkle. |
Happy you're enjoying this package!
The thing is that in Julia a matrix size is:
and a tensor is:
In this package we defined the size of the abstract operator as:
I have no clue if the devs of |
I am using the Conv operator as the first argument matrix-like operator in the Krylov.jl optimization functions.
It fails because the size() function applied to a Conv object does not return the expected tuple. Instead of
(m, n)
The Krylov.jl optimizer gets:
((m,), (n,))
If I override Base.size, it all works beautifully. Shouldn't the size operator conform to what is expected of a Matrix-like operator? Am I doing something wrong?
Edit: in order to silence a warning, I also had to override eltype() to return Float64 (in my case) instead of Any.
The text was updated successfully, but these errors were encountered: