Skip to content

Commit 85bec83

Browse files
authored
fix: add additional check in ignore_derivatives (#1717)
1 parent 52c7176 commit 85bec83

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Overlay.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ end
2424
@reactant_overlay function EnzymeCore.ignore_derivatives(args...)
2525
res = map(args) do arg
2626
return Functors.fmap(arg) do argᵢ
27-
argᵢ isa AnyTracedRArray &&
28-
(argᵢ = call_with_reactant(materialize_traced_array, argᵢ))
27+
if argᵢ isa AnyTracedRArray && !(argᵢ isa TracedType)
28+
argᵢ = call_with_reactant(materialize_traced_array, argᵢ)
29+
end
2930
argᵢ isa TracedType && return @opcall ignore_derivatives(argᵢ)
3031
return argᵢ
3132
end

0 commit comments

Comments
 (0)