-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
improve inferred effects for reshape for Array
#58672
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
improve inferred effects for reshape for Array
#58672
Conversation
|
Hello! I am a bot. Thank you for your pull request! I have assigned
Note: If you are a Julia committer, please make sure that your organization membership is public. |
f25cfd7 to
7381e22
Compare
|
FTR: the force push just added a |
|
Before: julia> VERSION
v"1.13.0-DEV.720"
julia> Base.infer_effects(reshape, Tuple{Vector{Float32}, Tuple{Int}})
(!c,!e,!n,!t,!s,!m,!u,+o,!r)
julia> Base.infer_effects(reshape, Tuple{Matrix{Float32}, Tuple{Int}})
(!c,!e,!n,!t,!s,!m,!u,+o,!r)
julia> Base.infer_effects(reshape, Tuple{Vector{Float32}, Tuple{Int, Int}})
(!c,!e,!n,!t,!s,!m,!u,+o,!r)
julia> Base.infer_effects(reshape, Tuple{Matrix{Float32}, Tuple{Int, Int}})
(!c,!e,!n,!t,!s,!m,!u,+o,!r)After: julia> VERSION
v"1.13.0-DEV.721"
julia> Base.infer_effects(reshape, Tuple{Vector{Float32}, Tuple{Int}})
(?c,+e,!n,+t,+s,?m,+u,+o,+r)
julia> Base.infer_effects(reshape, Tuple{Matrix{Float32}, Tuple{Int}})
(?c,+e,!n,+t,+s,?m,+u,+o,+r)
julia> Base.infer_effects(reshape, Tuple{Vector{Float32}, Tuple{Int, Int}})
(?c,+e,!n,+t,+s,?m,+u,+o,+r)
julia> Base.infer_effects(reshape, Tuple{Matrix{Float32}, Tuple{Int, Int}})
(?c,+e,!n,+t,+s,?m,+u,+o,+r) |
Use `LazyString` in `throw_dmrsa`.
bd8f634 to
c78e984
Compare
Based on #419 since `LazyString` and `lazy"..."` are only available in Julia >= 1.8. --- The PR changes all error messages to lazy strings to delay string interpolation and `print`ing of the involved quantities until the error message is displayed (and hence skip it completely if the error path is not hit). Using `LazyString`s in error messages generally also helps with type inference (see e.g. JuliaLang/julia#58672 and JuliaLang/julia#54737). --------- Co-authored-by: Jishnu Bhattacharya <[email protected]>
Use
LazyStringinthrow_dmrsa.