Skip to content

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
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