We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ff0216 commit 30dd2e4Copy full SHA for 30dd2e4
src/conv.jl
@@ -62,10 +62,12 @@ function conv(x::A, w::A; size=nothing, pad = 0, stride = 1, dilation = 1) where
62
conv!(similar(x, size), x, w, pad = pad_, stride = stride_, dilation = dilation)
63
end
64
65
-function crosscor(x::A, w::A; pad = 0, stride = 1, dilation = 1) where A<:AbstractArray
+function crosscor(x::A, w::A; size=nothing, pad = 0, stride = 1, dilation = 1) where A<:AbstractArray
66
pad_, stride_ = padtuple(x, pad), padtuple(x, stride)
67
- crosscor!(similar(x, cdims(size(x), dilation_dims(w, dilation), pad_, stride_)),
68
- x, w, pad = pad_, stride = stride_, dilation = dilation)
+ if size === nothing
+ size = cdims(Base.size(x), dilation_dims(w, dilation), pad_, stride_)
69
+ end
70
+ crosscor!(similar(x, size), x, w, pad = pad_, stride = stride_, dilation = dilation)
71
72
73
function ∇conv_data(dy::A, w::A; size=nothing, pad = 0, stride = 1, dilation = 1, flipkernel = 0) where A<:AbstractArray
0 commit comments