Skip to content

Commit 249502d

Browse files
committed
inference acc: add round to even for average pooling output.
1 parent 707098b commit 249502d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/caffe/layers/pooling_layer.cu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ __global__ void AvePoolForward(const int nthreads,
8585
}
8686
if (output_shift_instead_division != Dtype(0)) {
8787
top_data[index] = aveval / output_shift_instead_division;
88+
top_data[index] = rint(top_data[index]);
8889
}
8990
else{
9091
top_data[index] = aveval / pool_size;
@@ -136,6 +137,7 @@ __global__ void AvePoolForward_TF(const int nthreads,
136137
top_data[index] = aveval / output_shift_instead_division;
137138
else
138139
top_data[index] = aveval / output_shift_instead_division * full_pool_size / pool_size;
140+
top_data[index] = rint(top_data[index]);
139141
}
140142
else{
141143
top_data[index] = aveval / pool_size;

0 commit comments

Comments
 (0)