Skip to content

Commit f7d4b3f

Browse files
Kenooxinabox
authored andcommitted
Get rid of useless broadcasting
1 parent bc830c6 commit f7d4b3f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rule_definition_tools.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ derivative/setup expressions.
5656
This macro assumes complex functions are holomorphic. In general, for non-holomorphic
5757
functions, the `frule` and `rrule` must be defined manually.
5858
59-
If the derivative is one, (e.g. for identity functions) `true` can be used as the most
59+
If the derivative is one, (e.g. for identity functions) `true` can be used as the most
6060
general multiplicative identity.
6161
6262
The `@setup` argument can be elided if no setup code is need. In other
@@ -249,11 +249,11 @@ function propagation_expr(Δs, ∂s, _conj=false, proj=identity)
249249
summed_∂_mul_Δs = if n∂s > 1
250250
# Explicit multiplication is only performed for the first pair
251251
# of partial and gradient.
252-
init_expr = :((*).($(_∂s[1]), $(Δs[1])))
252+
init_expr = :(*($(_∂s[1]), $(Δs[1])))
253253

254254
# Apply `muladd` iteratively.
255255
foldl(Iterators.drop(zip(_∂s, Δs), 1); init=init_expr) do ex, (∂s_i, Δs_i)
256-
:((muladd).($∂s_i, $Δs_i, $ex))
256+
:(muladd($∂s_i, $Δs_i, $ex))
257257
end
258258
else
259259
# Note: we don't want to do broadcasting with only 1 multiply (no `+`),

0 commit comments

Comments
 (0)