Skip to content

Commit

Permalink
work around extreme slowdown due julia performance bug
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Jan 30, 2019
1 parent 8386a49 commit 3ab3e1c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/layers/normalise.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ function (BN::BatchNorm)(x)
end

let λ = BN.λ
λ.(reshape(γ, affine_shape...) .* ((x .- μ) ./ sqrt.(σ² .+ BN.ϵ)) .+ reshape(β, affine_shape...))
v = reshape(γ, affine_shape...) .* ((x .- μ) ./ sqrt.(σ² .+ BN.ϵ)) .+ reshape(β, affine_shape...)
# This is intentionally not fused because of an extreme slowdown doing so
λ.(v)
end
end

Expand Down

0 comments on commit 3ab3e1c

Please sign in to comment.