Skip to content

Commit 1f6afb1

Browse files
author
ShoofLLC
committed
Updated the dropout function to prevent it from changing types when used when an Int input.
1 parent 179dfe2 commit 1f6afb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/layers/normalise.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The [`Dropout`](@ref) layer is what you should use in most scenarios.
3434
function dropout(rng, x, p; dims=:, active::Bool=true)
3535
active || return x
3636
y = dropout_mask(rng, x, p, dims=dims)
37-
return x .* y
37+
return x .* iszero.(y)
3838
end
3939
dropout(x, p; kwargs...) = dropout(rng_from_array(x), x, p; kwargs...)
4040

0 commit comments

Comments
 (0)