File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ function EnzymeCore.EnzymeRules.reverse(config, func::EnzymeCore.Const{typeof(NN
122
122
end
123
123
124
124
ddsts = dst. dval
125
- dsrcs = src. dval
125
+ dsrcs = ( typeof (src) <: EnzymeCore.Const ) ? ddsts : src. dval
126
126
127
127
if EnzymeCore. EnzymeRules. width (config) == 1
128
128
ddsts = (ddsts,)
@@ -182,7 +182,7 @@ function EnzymeCore.EnzymeRules.reverse(config, func::EnzymeCore.Const{typeof(NN
182
182
end
183
183
184
184
ddsts = dst. dval
185
- dsrcs = src. dval
185
+ dsrcs = ( typeof (src) <: EnzymeCore.Const ) ? ddsts : src. dval
186
186
187
187
if EnzymeCore. EnzymeRules. width (config) == 1
188
188
ddsts = (ddsts,)
@@ -322,12 +322,6 @@ function EnzymeCore.EnzymeRules.augmented_primal(config, func::EnzymeCore.Const{
322
322
keep = nothing
323
323
end
324
324
325
- # Cache idx if its overwritten
326
- cache_idx = ( EnzymeCore. EnzymeRules. overwritten (config)[4 ]
327
- && ! (typeof (src) <: EnzymeCore.Const )
328
- && ! (typeof (dst) <: EnzymeCore.Const )
329
- ) ? copy (idx. val) : nothing
330
-
331
325
return EnzymeCore. EnzymeRules. AugmentedReturn (primal, shadow, keep)
332
326
end
333
327
@@ -336,7 +330,7 @@ function EnzymeCore.EnzymeRules.reverse(config, func::EnzymeCore.Const{typeof(NN
336
330
val = convert (T, 1 / (1 - p. val))
337
331
338
332
ddsts = dst. dval
339
- dsrcs = src. dval
333
+ dsrcs = ( typeof (src) <: EnzymeCore.Const ) ? ddsts : src. dval
340
334
341
335
if EnzymeCore. EnzymeRules. width (config) == 1
342
336
ddsts = (ddsts,)
You can’t perform that action at this time.
0 commit comments