Skip to content

Commit

Permalink
Skip conv_bias_act with Flux.Zeros
Browse files Browse the repository at this point in the history
  • Loading branch information
darsnack committed Feb 7, 2022
1 parent 6573f65 commit 8b5b26a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/layers/conv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ function (c::Conv)(x::AbstractArray)
end

_conv_bias_act(x, w, cdims, b, σ) = NNlib.conv_bias_act(x, w, cdims, b, σ)
_conv_bias_act(x, w, cdims, ::Zeros, σ) = σ.(conv(x, w, cdims))
_conv_bias_act(x::CuArray, w::CuArray, cdims, b::Zeros, σ) =
_conv_bias_act(x, w, cdims, CUDA.zeros(size(b)...), σ)

Expand Down

0 comments on commit 8b5b26a

Please sign in to comment.