Skip to content

Commit e9f7d35

Browse files
committed
Performance fix for GammaRule
this enables fused broadcasting
1 parent 1b89825 commit e9f7d35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lrp_rules.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ struct GammaRule{T} <: AbstractLRPRule
152152
end
153153
function modify_param!(r::GammaRule, param::AbstractArray{T}) where {T}
154154
γ = convert(T, r.γ)
155-
param .+= γ * relu.(param)
155+
param .+= γ .* relu.(param)
156156
return nothing
157157
end
158-
@inline check_compat(rule::GammaRule, layer) = require_weight_and_bias(rule, layer)
158+
159159

160160
"""
161161
PassRule()

0 commit comments

Comments
 (0)