@@ -154,8 +154,8 @@ See also: [`depthwiseconvfilter`](@ref)
154
154
"""
155
155
function convfilter (filter:: NTuple{N,Integer} , ch:: Pair{<:Integer,<:Integer} ;
156
156
init = glorot_uniform, groups= 1 ) where N
157
- cin, cout = ch
158
- init (filter... , cin÷ groups, cout)
157
+ cin, cout = ch
158
+ init (filter... , cin÷ groups, cout)
159
159
end
160
160
161
161
@functor Conv
@@ -182,7 +182,7 @@ function _print_conv_opt(io::IO, l)
182
182
all (== (1 ), l. stride) || print (io, " , stride=" , _maybetuple_string (l. stride))
183
183
all (== (1 ), l. dilation) || print (io, " , dilation=" , _maybetuple_string (l. dilation))
184
184
if hasproperty (l, :groups )
185
- (l. groups == 1 ) || print (io, " , groups=" , l. groups)
185
+ (l. groups == 1 ) || print (io, " , groups=" , l. groups)
186
186
end
187
187
(l. bias isa Zeros) && print (io, " , bias=false" )
188
188
end
@@ -259,19 +259,19 @@ end
259
259
@functor ConvTranspose
260
260
261
261
function conv_transpose_dims (c:: ConvTranspose , x:: AbstractArray )
262
- # Calculate size of "input", from ∇conv_data()'s perspective...
263
- combined_pad = (c. pad[1 : 2 : end ] .+ c. pad[2 : 2 : end ])
264
- I = (size (x)[1 : end - 2 ] .- 1 ). * c. stride .+ 1 .+ (size (c. weight)[1 : end - 2 ] .- 1 ). * c. dilation .- combined_pad
265
- C_in = size (c. weight)[end - 1 ] * c. groups
266
- batch_size = size (x)[end ]
267
- # Create DenseConvDims() that looks like the corresponding conv()
268
- w_size = size (c. weight)
269
- return DenseConvDims ((I... , C_in, batch_size), w_size;
270
- stride= c. stride,
271
- padding= c. pad,
272
- dilation= c. dilation,
273
- groups= c. groups,
274
- )
262
+ # Calculate size of "input", from ∇conv_data()'s perspective...
263
+ combined_pad = (c. pad[1 : 2 : end ] .+ c. pad[2 : 2 : end ])
264
+ I = (size (x)[1 : end - 2 ] .- 1 ). * c. stride .+ 1 .+ (size (c. weight)[1 : end - 2 ] .- 1 ). * c. dilation .- combined_pad
265
+ C_in = size (c. weight)[end - 1 ] * c. groups
266
+ batch_size = size (x)[end ]
267
+ # Create DenseConvDims() that looks like the corresponding conv()
268
+ w_size = size (c. weight)
269
+ return DenseConvDims ((I... , C_in, batch_size), w_size;
270
+ stride= c. stride,
271
+ padding= c. pad,
272
+ dilation= c. dilation,
273
+ groups= c. groups,
274
+ )
275
275
end
276
276
277
277
# TODO : Find proper fix for https://github.com/FluxML/Flux.jl/issues/900
0 commit comments