Skip to content

Commit

Permalink
Update src/layers/basic.jl
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Chen <[email protected]>
  • Loading branch information
theabhirath and ToucheSir authored Apr 2, 2022
1 parent 1f68819 commit 7465575
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/layers/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Diagonal(sz::Integer...; σ = identity, bias = true, init = ones32) = Diagonal(i

function (a::Diagonal)(x::AbstractArray)
σ = NNlib.fast_act(a.σ, x) # replaces tanh => tanh_fast, etc
return σ == typeof(identity) ? a.scale .* x .+ a.bias : σ.(a.scale .* x .+ a.bias)
return σ === typeof(identity) ? a.scale .* x .+ a.bias : σ.(a.scale .* x .+ a.bias)
end

function Base.show(io::IO, l::Diagonal)
Expand Down

0 comments on commit 7465575

Please sign in to comment.