Skip to content

Commit 6386c5d

Browse files
committed
fix indentation
1 parent b269477 commit 6386c5d

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/layers/conv.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ See also: [`depthwiseconvfilter`](@ref)
154154
"""
155155
function convfilter(filter::NTuple{N,Integer}, ch::Pair{<:Integer,<:Integer};
156156
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)
159159
end
160160

161161
@functor Conv
@@ -182,7 +182,7 @@ function _print_conv_opt(io::IO, l)
182182
all(==(1), l.stride) || print(io, ", stride=", _maybetuple_string(l.stride))
183183
all(==(1), l.dilation) || print(io, ", dilation=", _maybetuple_string(l.dilation))
184184
if hasproperty(l, :groups)
185-
(l.groups == 1) || print(io, ", groups=", l.groups)
185+
(l.groups == 1) || print(io, ", groups=", l.groups)
186186
end
187187
(l.bias isa Zeros) && print(io, ", bias=false")
188188
end
@@ -259,19 +259,19 @@ end
259259
@functor ConvTranspose
260260

261261
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+
)
275275
end
276276

277277
# TODO: Find proper fix for https://github.com/FluxML/Flux.jl/issues/900

0 commit comments

Comments
 (0)