Skip to content

Commit b94257f

Browse files
committed
Initial commit
1 parent b653dc1 commit b94257f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/conv.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ padtuple(x::Tuple,p::Integer) = map(_->p, head(head(x)))
2424
padtuple(x::Tuple,p::Tuple) = p
2525
padtuple(x::AbstractArray,p) = padtuple(size(x),p)
2626

27-
function conv(x::A, w::A; pad = 0, stride = 1, dilation = 1) where A<:AbstractArray
27+
function conv(x::A, w::A; pad = 0, stride = 1, dilation = 1, mode = 0) where A<:AbstractArray
2828
pad_, stride_ = padtuple(x, pad), padtuple(x, stride)
2929
conv!(similar(x, cdims(size(x), dilation_dims(w, dilation), pad_, stride_)),
30-
x, w, pad = pad_, stride = stride_, dilation = dilation)
30+
x, w, pad = pad_, stride = stride_, dilation = dilation, mode = mode)
3131
end
3232

3333
∇conv_data(dy::A, x::A, w::A; pad = 0, stride = 1, dilation = 1) where A<:AbstractArray =
@@ -62,8 +62,8 @@ function ∇conv_data!(dx::AbstractArray{T,3}, dy::AbstractArray{T,3},
6262
end
6363

6464
conv!(y::AbstractArray{T,4}, x::AbstractArray{T,4}, w::AbstractArray{T,4};
65-
pad = 0, stride = 1, dilation = 1) where T =
66-
conv2d!(y, x, w, padding = pad, stride = stride, dilation = dilation)
65+
pad = 0, stride = 1, dilation = 1, mode=0) where T =
66+
conv2d!(y, x, w, padding = pad, stride = stride, dilation = dilation, mode=mode)
6767

6868
∇conv_filter!(dw::AbstractArray{T,4}, dy::AbstractArray{T,4}, x::AbstractArray{T,4}, w::AbstractArray{T,4};
6969
pad = 0, stride = 1, dilation = 1) where T =

0 commit comments

Comments
 (0)