@@ -196,10 +196,11 @@ ChainRulesCore.@non_differentiable conv_dims(::Any, ::Any)
196
196
197
197
function (c:: Conv )(x:: AbstractArray )
198
198
_size_check (c, x, ndims (x)- 1 => _channels_in (c))
199
- σ = NNlib. fast_act (c. σ, x)
199
+ # σ = NNlib.fast_act(c.σ, x)
200
200
cdims = conv_dims (c, x)
201
201
xT = _match_eltype (c, x)
202
- σ .(conv (xT, c. weight, cdims) .+ conv_reshape_bias (c))
202
+ # σ.(conv(xT, c.weight, cdims) .+ conv_reshape_bias(c))
203
+ NNlib. bias_act! (c. σ, conv (xT, c. weight, cdims), conv_reshape_bias (c))
203
204
end
204
205
205
206
_channels_in (l:: Conv ) = size (l. weight, ndims (l. weight)- 1 ) * l. groups
@@ -332,10 +333,11 @@ ChainRulesCore.@non_differentiable conv_transpose_dims(::Any, ::Any)
332
333
333
334
function (c:: ConvTranspose )(x:: AbstractArray )
334
335
_size_check (c, x, ndims (x)- 1 => _channels_in (c))
335
- σ = NNlib. fast_act (c. σ, x)
336
+ # σ = NNlib.fast_act(c.σ, x)
336
337
cdims = conv_transpose_dims (c, x)
337
338
xT = _match_eltype (c, x)
338
- σ .(∇conv_data (xT, c. weight, cdims) .+ conv_reshape_bias (c))
339
+ # σ.(∇conv_data(xT, c.weight, cdims) .+ conv_reshape_bias(c))
340
+ NNlib. bias_act! (c. σ, ∇conv_data (xT, c. weight, cdims), conv_reshape_bias (c))
339
341
end
340
342
341
343
function Base. show (io:: IO , l:: ConvTranspose )
@@ -474,10 +476,11 @@ ChainRulesCore.@non_differentiable crosscor_dims(::Any, ::Any)
474
476
475
477
function (c:: CrossCor )(x:: AbstractArray )
476
478
_size_check (c, x, ndims (x)- 1 => _channels_in (c))
477
- σ = NNlib. fast_act (c. σ, x)
479
+ # σ = NNlib.fast_act(c.σ, x)
478
480
cdims = crosscor_dims (c, x)
479
481
xT = _match_eltype (c, x)
480
- σ .(crosscor (xT, c. weight, cdims) .+ conv_reshape_bias (c))
482
+ # σ.(crosscor(xT, c.weight, cdims) .+ conv_reshape_bias(c))
483
+ NNlib. bias_act! (c. σ, crosscor (xT, c. weight, cdims), conv_reshape_bias (c))
481
484
end
482
485
483
486
function Base. show (io:: IO , l:: CrossCor )
0 commit comments