Skip to content

Commit 0cc562a

Browse files
committed
remove scalar thunking
1 parent 815836c commit 0cc562a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/rule_definition_tools.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,7 @@ function propagation_expr(Δs, ∂s)
215215
# This is basically Δs ⋅ ∂s
216216
∂s = map(esc, ∂s)
217217

218-
# Notice: the thunking of `∂s[i] (potentially) saves us some computation
219-
# if `Δs[i]` is a `AbstractDifferential` otherwise it is computed as soon
220-
# as the pullback is evaluated
221-
∂_mul_Δs = [:(@thunk($(∂s[i])) * $(Δs[i])) for i in 1:length(∂s)]
218+
∂_mul_Δs = ntuple(i->:($(∂s[i]) * $(Δs[i])), length(∂s))
222219
return :(+($(∂_mul_Δs...)))
223220
end
224221

0 commit comments

Comments
 (0)