Skip to content
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

remove type specification in the generic __normalize! #41045

Merged
merged 2 commits into from
Jun 5, 2021

Conversation

GiggleLiu
Copy link
Contributor

It will solve the following issue of differentiating normalize! with ForwardDiff. It does not make much sense to specify types in a "private" function.

julia> using ForwardDiff: Dual
julia> using LinearAlgebra

julia> normalize!(Dual.(randn(13), randn(13)))
ERROR: MethodError: no method matching __normalize!(::Vector{Dual{Nothing, Float64, 1}}, ::Dual{Nothing, Float64, 1})
Closest candidates are:
  __normalize!(::AbstractArray, ::AbstractFloat) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/generic.jl:1678
Stacktrace:
 [1] normalize!(a::Vector{Dual{Nothing, Float64, 1}}, p::Int64)
   @ LinearAlgebra /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/generic.jl:1675
 [2] normalize!(a::Vector{Dual{Nothing, Float64, 1}})
   @ LinearAlgebra /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/generic.jl:1674
 [3] top-level scope
   @ REPL[6]:1

@dkarrasch dkarrasch added the linear algebra Linear algebra label Jun 3, 2021
@dkarrasch dkarrasch merged commit 443a1b6 into JuliaLang:master Jun 5, 2021
shirodkara pushed a commit to shirodkara/julia that referenced this pull request Jun 9, 2021
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants