Closed kpobrien closed 4 weeks ago
The same example with MMatrix from StaticArrays.jl instead of Matrix does not error and may be a workaround:
using LinearAlgebra
import Enzyme, StaticArrays
function test3!(A)
A .= A \ (StaticArrays.@MMatrix [1.0 0;0.0 1.0])
return nothing
end
A = StaticArrays.@MMatrix rand(2,2)
dA = StaticArrays.@MMatrix [1.0 0.0; 0.0 0.0]
Enzyme.autodiff(
Enzyme.Reverse,
test3!,
Enzyme.Duplicated(A,dA),
)
looks like something which expected a vector got a matrix, let me investigate
Should be solved by https://github.com/EnzymeAD/Enzyme.jl/pull/1754
I confirmed your PR #1754 resolves the issue, so I'll close this. Thank you!
Hi, I'm trying to use Enzyme for reverse diff of a function that uses left division. For x = A \ b, I get errors if b is a matrix but no errors if b is a vector. Here is a MWE that illustrates the error.
Using a vector for b runs without error. This is a potential workaround but is not ideal as it would require re-writing other code in a way that doesn't reuse the factorization:
and this errors:
Is this a bug or intended behavior? Would you suggest trying to fix this in Enzyme.jl or writing my own rule?
Thanks!