Skip to content

Commit fd2c602

Browse files
author
Avik Pal
committed
Flip weights while returning
1 parent 524f35e commit fd2c602

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/nnpack/nnlib.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@ end
117117

118118
function ∇conv_filter!(dw::AA{4}, dy::AA{4}, x::AA{4}, w::AA{4}; pad = 0, stride = 1, dilation = 1, algo = UInt32(0), flipkernel = 0)
119119
flipkernel == 0 && (w = reverse(reverse(w, dims=1), dims=2))
120-
nnp_convolution_kernel_gradient(dw, x, dy, w, padding = pad, stride = stride, algo = algo, threadpool = shared_threadpool)
120+
dw .= nnp_convolution_kernel_gradient(dw, x, dy, w, padding = pad, stride = stride, algo = algo, threadpool = shared_threadpool)
121+
flipkernel == 0 ? reverse(reverse(dw, dims=1), dims=2) : dw
121122
end

0 commit comments

Comments
 (0)