Skip to content

Commit c85ec1e

Browse files
author
Anton Smirnov
committed
Reduce number of changes
1 parent 9e7cef2 commit c85ec1e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/layers/conv.jl

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ end
162162

163163
function (c::Conv)(x::AbstractArray)
164164
σ, b = c.σ, reshape(c.bias, ntuple(_ -> 1, length(c.stride))..., :, 1)
165-
cdims = DenseConvDims(
166-
x, c.weight; stride=c.stride, padding=c.pad,
167-
dilation=c.dilation, groups=c.groups)
165+
cdims = DenseConvDims(x, c.weight; stride = c.stride, padding = c.pad, dilation = c.dilation, groups = c.groups)
168166
σ.(conv(x, c.weight, cdims) .+ b)
169167
end
170168

@@ -658,23 +656,19 @@ julia> lay(rand(Float32, 100, 7, 50)) |> size
658656
(34, 7, 50)
659657
```
660658
"""
661-
struct MaxPool{N, M}
659+
struct MaxPool{N,M}
662660
k::NTuple{N,Int}
663661
pad::NTuple{M,Int}
664662
stride::NTuple{N,Int}
665663
end
666664

667-
function MaxPool(k::NTuple{N, Integer}; pad = 0, stride = k) where N
665+
function MaxPool(k::NTuple{N,Integer}; pad = 0, stride = k) where N
668666
stride = expand(Val(N), stride)
669667
pad = calc_padding(MaxPool, pad, k, 1, stride)
670668
return MaxPool(k, pad, stride)
671669
end
672670

673671
function (m::MaxPool)(x)
674-
# size_x = size(x)
675-
# kernel, stride, padding, dilation = NNlib.prepare_pooldims(
676-
# Val(N), size_x, m.k; padding=m.pad, stride=m.stride)
677-
# pdims = PoolDims{kernel, stride, padding, dilation}(size_x)
678672
pdims = PoolDims(x, m.k; padding=m.pad, stride=m.stride)
679673
return maxpool(x, pdims)
680674
end

0 commit comments

Comments
 (0)