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

Error when using AD on eigen #219

Open
lijas opened this issue Jul 2, 2024 · 1 comment
Open

Error when using AD on eigen #219

lijas opened this issue Jul 2, 2024 · 1 comment

Comments

@lijas
Copy link

lijas commented Jul 2, 2024

This has worked before, but seems to be broken now.
Probably related to JuliaDiff/ForwardDiff.jl#703 , but I don't understand how to fix it.

# add Tensors 
using Tensors    
function myfunk(e)
      p, n = Tensors.eigen(e)
      return otimes(n[:,1])
end;
e = rand(SymmetricTensor{2,3});
Tensors.gradient(myfunk, e)

Gives this error:

ERROR: setindex!(::StaticArraysCore.SMatrix{3, 3, Float64, 9}, value, ::Int) is not defined.
 Hint: Use `MArray` or `SizedArray` to create a mutable static array
@KnutAM
Copy link
Member

KnutAM commented Jul 2, 2024

Realized that this actually works due to JuliaDiff/ForwardDiff.jl#703, but the problem is that that one isn't released in ForwardDiff, because ForwardDiff is stuck on 0.10 and seems to be very unclear when changes on master will be released...

I could get the above example to work by (need to trick Tensors.jl to allow (ForwardDiff v0.11.0-DEV)

  • Add Tensors to global (shared) environment
  • Add ForwardDiff#master to current environment
  • Run code above

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