mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-23 15:16:26 +01:00
cnn/make:dense_linearized: fix wrong indices
This commit is contained in:
parent
3d7b641965
commit
0fb23c9b15
@ -257,7 +257,7 @@ __global__ void make_dense_linearized_kernel(float** weights, float* bias, float
|
||||
for (int i=0; i < input_depth; i++) {
|
||||
for (int j=0; j < input_width; j++) {
|
||||
for (int k=0; k < input_width; k++) {
|
||||
f += input[i][j][k]*weights[k + j*input_width + i*input_depth][idx];
|
||||
f += input[i][j][k]*weights[k + (i*input_width+j)*input_width][idx];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -285,7 +285,7 @@ void make_dense_linearized_cpu(Kernel_nn* kernel, float*** input, float* output,
|
||||
for (int i=0; i < input_depth; i++) {
|
||||
for (int j=0; j < input_width; j++) {
|
||||
for (int k=0; k < input_width; k++) {
|
||||
f += input[i][j][k]*kernel->weights[k + j*input_width + i*input_depth][l];
|
||||
f += input[i][j][k]*kernel->weights[k + (i*input_width+j)*input_width][l];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ __global__ void make_dense_linearized_kernel(float** weights, float* bias, float
|
||||
for (int i=0; i < input_depth; i++) {
|
||||
for (int j=0; j < input_width; j++) {
|
||||
for (int k=0; k < input_width; k++) {
|
||||
f += input[i][j][k]*weights[k + j*input_width + i*input_depth][idx];
|
||||
f += input[i][j][k]*weights[k + (i*input_width+j)*input_width][idx];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -285,7 +285,7 @@ void make_dense_linearized_cpu(Kernel_nn* kernel, float*** input, float* output,
|
||||
for (int i=0; i < input_depth; i++) {
|
||||
for (int j=0; j < input_width; j++) {
|
||||
for (int k=0; k < input_width; k++) {
|
||||
f += input[i][j][k]*kernel->weights[k + j*input_width + i*input_depth][l];
|
||||
f += input[i][j][k]*kernel->weights[k + (i*input_width+j)*input_width][l];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user