Skip to content

Commit 5aae073

Browse files
author
Глеб Брыкин
authored
Add files via upload
1 parent f87e3d8 commit 5aae073

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Implementation/src/MKL/Ops/Backward/dAvgPool2d.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//* The code is available under the Apache-2.0 license. Read the License for details.
44
//***************************************************************************************************
55

6-
//-> Latest commit: Brykin Gleb, 22.03.2021
6+
//-> Latest commit: Brykin Gleb, 30.03.2021
77

88
using System;
99
using System.Threading;
@@ -66,7 +66,7 @@ public static void dAvgPool2d(Half[] dx, int[] x_shape, System.Tuple<int, int> k
6666
{
6767
continue;
6868
}
69-
dx[((c * x_batch + b) * x_height + iy) * x_width + ix] += grad;
69+
dx[((b * x_channel + c) * x_height + iy) * x_width + ix] += grad;
7070
}
7171
}
7272
}
@@ -120,7 +120,7 @@ public static void dAvgPool2d(float[] dx, int[] x_shape, System.Tuple<int, int>
120120
{
121121
continue;
122122
}
123-
dx[((c * x_batch + b) * x_height + iy) * x_width + ix] += grad;
123+
dx[((b * x_channel + c) * x_height + iy) * x_width + ix] += grad;
124124
}
125125
}
126126
}
@@ -174,7 +174,7 @@ public static void dAvgPool2d(double[] dx, int[] x_shape, System.Tuple<int, int>
174174
{
175175
continue;
176176
}
177-
dx[((c * x_batch + b) * x_height + iy) * x_width + ix] += grad;
177+
dx[((b * x_channel + c) * x_height + iy) * x_width + ix] += grad;
178178
}
179179
}
180180
}

Implementation/src/MKL/Ops/Backward/dMaxPool2d.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//* The code is available under the Apache-2.0 license. Read the License for details.
44
//***************************************************************************************************
55

6-
//-> Latest commit: Brykin Gleb, 22.03.2021
6+
//-> Latest commit: Brykin Gleb, 30.03.2021
77

88
using System;
99
using System.Threading;
@@ -36,7 +36,7 @@ public static void dMaxPool2d(Half[] dx, long[] indices, Half[] dy, int[] y_shap
3636
{
3737
for(int oy = 0; oy < y_height; oy++)
3838
{
39-
var i = ((c * y_batch + b) * y_height + oy) * y_width + ox;
39+
var i = ((b * y_channel + c) * y_height + oy) * y_width + ox;
4040
dx[indices[i]] += dy[i];
4141
}
4242
}
@@ -59,7 +59,7 @@ public static void dMaxPool2d(float[] dx, long[] indices, float[] dy, int[] y_sh
5959
{
6060
for(int oy = 0; oy < y_height; oy++)
6161
{
62-
var i = ((c * y_batch + b) * y_height + oy) * y_width + ox;
62+
var i = ((b * y_channel + c) * y_height + oy) * y_width + ox;
6363
dx[indices[i]] += dy[i];
6464
}
6565
}
@@ -82,7 +82,7 @@ public static void dMaxPool2d(double[] dx, long[] indices, double[] dy, int[] y_
8282
{
8383
for(int oy = 0; oy < y_height; oy++)
8484
{
85-
var i = ((c * y_batch + b) * y_height + oy) * y_width + ox;
85+
var i = ((b * y_channel + c) * y_height + oy) * y_width + ox;
8686
dx[indices[i]] += dy[i];
8787
}
8888
}

0 commit comments

Comments
 (0)