diff --git a/src/sugar.jl b/src/sugar.jl index d108203e12..ff94c7cf94 100644 --- a/src/sugar.jl +++ b/src/sugar.jl @@ -296,7 +296,7 @@ grad = gradient(ReverseWithPrimal, mul, [2.0], Const([3.0])) enz_args = Union{Expr,Symbol}[] resargs = Union{Expr,Symbol[] for (i, (arg, act, state, genty)) in enumerate(zip(rargs, acts, states, gentys)) - shad = Symbol("shad_$idx") + shad = Symbol("shad_$i") if genty <: Enzyme.Const push!(enz_args, arg) push!(resargs, :nothing)