-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Matrix * Vector uses convert with promote_op, causes issues on 1.1+ #632
Comments
Great example --- inferring a more specific type can actually break things when |
ararslan
referenced
this issue
in JuliaLang/julia
May 20, 2019
This method entirely duplicates the one below it with the exception that it also does a `convert` on one of the inputs with the result of `promote_op`, which doesn't make a whole lot of sense in some cases. By virtue of calling `mul!`, strided arrays that go through the abstract array method will still hit the same optimized methods that use BLAS. Fixes #32092.
ararslan
referenced
this issue
in JuliaLang/julia
May 22, 2019
This restricts the element type of the input vector to be `<:Real` and only converts in case the promoted type is concrete. Fixes #32092.
JeffBezanson
referenced
this issue
in JuliaLang/julia
May 23, 2019
This restricts the element type of the input vector to be `<:Real` and only converts in case the promoted type is concrete. Fixes #32092.
KristofferC
referenced
this issue
in JuliaLang/julia
May 23, 2019
This restricts the element type of the input vector to be `<:Real` and only converts in case the promoted type is concrete. Fixes #32092. (cherry picked from commit 587cb82)
KristofferC
referenced
this issue
in JuliaLang/julia
Aug 26, 2019
This restricts the element type of the input vector to be `<:Real` and only converts in case the promoted type is concrete. Fixes #32092. (cherry picked from commit 587cb82)
KristofferC
referenced
this issue
in JuliaLang/julia
Aug 26, 2019
This restricts the element type of the input vector to be `<:Real` and only converts in case the promoted type is concrete. Fixes #32092. (cherry picked from commit 587cb82)
KristofferC
referenced
this issue
in JuliaLang/julia
Feb 20, 2020
This restricts the element type of the input vector to be `<:Real` and only converts in case the promoted type is concrete. Fixes #32092. (cherry picked from commit 587cb82)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't have a minimal reproducing example at the moment, since this arose in private code, but consider the following situation: Say you have a
Matrix{Float64}
calledA
and aVector{K}
calledx
, whereK
is an abstract type. Various operations such as+
and*
are defined forK
to return specific subtypes. The subtypes do notconvert
between each other.A * x
should work; all of the necessary operations are defined.With Julia 1.0, we get a
Vector{Any}
fromA * x
. Not ideal but fine. On 1.1, we get an error, saying it can't convertx
's elements to a certain type. The issue seems to boil down to this difference:On 1.0:
1.1:
LinearAlgebra then tries to do
convert(AbstractArray{Union{K1, K2, K3}, x)
, which fails, since it can't convertx
's elements to that type.As of JuliaLang/julia#29739,
promote_op
is just a wrapper atop_return_type
, which is returning the correct answer, but is not appropriate for this use.The text was updated successfully, but these errors were encountered: