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

Support normalize #521

Closed
oschulz opened this issue Jun 12, 2021 · 2 comments
Closed

Support normalize #521

oschulz opened this issue Jun 12, 2021 · 2 comments

Comments

@oschulz
Copy link

oschulz commented Jun 12, 2021

We should support LinearAlgebra.normalize and LinearAlgebra.normalize!. Unfortunately, the default implementation isn't compatible with duals, because LinearAlgebra.__normalize! requires an AbstractFloat:

julia> normalize!(ForwardDiff.Dual.(rand(5), rand(5)))
ERROR: MethodError: no method matching __normalize!(::Vector{ForwardDiff.Dual{Nothing, Float64, 1}}, ::ForwardDiff.Dual{Nothing, Float64, 1})
Closest candidates are:
  __normalize!(::AbstractArray, ::AbstractFloat) at [...]/LinearAlgebra/src/generic.jl:1678
@KristofferC
Copy link
Collaborator

JuliaLang/julia#41045

@oschulz
Copy link
Author

oschulz commented Jun 14, 2021

Thanks, @KristofferC !

@oschulz oschulz closed this as completed Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants