Skip to content
Snippets Groups Projects
Commit 382f6d47 authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Fixed dimensions inversion

parent f82e2915
No related branches found
No related tags found
2 merge requests!1890.7.0,!186Fixed dimensions inversion in Conv
Pipeline #81016 passed
...@@ -633,8 +633,8 @@ void ConvImpl2D_cpu_forward_kernel(const array<DimSize_t, 2> &strideDims, ...@@ -633,8 +633,8 @@ void ConvImpl2D_cpu_forward_kernel(const array<DimSize_t, 2> &strideDims,
iIndex_channel += iIndex_channel +=
inputDims[3] * strideDims[0]) { inputDims[3] * strideDims[0]) {
// loop over associated input line // loop over associated input line
for (std::size_t ky = 0, ix = 0; ky < kernelDims[1]; for (std::size_t kx = 0, ix = 0; kx < kernelDims[0];
++ky, ix += inputDims[3] * dilationDims[0]) { ++kx, ix += inputDims[3] * dilationDims[0]) {
// loop over the entire line // loop over the entire line
for (std::size_t oy = 0, iy = 0; oy < oySize; for (std::size_t oy = 0, iy = 0; oy < oySize;
++oy, iy += strideDims[1]) { ++oy, iy += strideDims[1]) {
...@@ -642,12 +642,12 @@ void ConvImpl2D_cpu_forward_kernel(const array<DimSize_t, 2> &strideDims, ...@@ -642,12 +642,12 @@ void ConvImpl2D_cpu_forward_kernel(const array<DimSize_t, 2> &strideDims,
iIndex_channel + ix + iy; iIndex_channel + ix + iy;
// loop over elements assosicated with one // loop over elements assosicated with one
// output // output
for (std::size_t kx = 0; kx < kernelDims[0]; for (std::size_t ky = 0; ky < kernelDims[1];
++kx) { ++ky) {
output[oIndex + oy] += output[oIndex + oy] +=
weights[wIndex + kernelDims[0] * ky + weights[wIndex + kernelDims[1] * kx +
kx] * ky] *
input[iIndex + kx * dilationDims[1]]; input[iIndex + ky * dilationDims[1]];
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment