Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/rule_definition_tools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ function propagation_expr(Δs, ∂s, _conj=false, proj=identity)

# Apply `muladd` iteratively.
# Explicit multiplication is only performed for the first pair of partial and gradient.
init_expr = :(*($(_∂s[1]), $(Δs[1])))
_∂s_Δs_tail = Iterators.drop(zip(_∂s, Δs), 1)
(∂s_1, Δs_1), _∂s_Δs_tail = Iterators.peel(zip(_∂s, Δs))
init_expr = :($∂s_1 * $Δs_1)
summed_∂_mul_Δs = foldl(_∂s_Δs_tail; init=init_expr) do ex, (∂s_i, Δs_i)
:(muladd($∂s_i, $Δs_i, $ex))
end
Expand Down