Skip to content

Commit ec65665

Browse files
committed
evquantize: unsigned saturate range fix.
1 parent 57a27d2 commit ec65665

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/caffe/util/math_functions.cu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ __global__ void unsigned_saturate_kernel(const int n, Dtype* y) {
229229
CUDA_KERNEL_LOOP(index, n) {
230230
if(y[index] > UNSIGNED_SATURATE_MAX)
231231
y[index] = SIGNED_SATURATE_MAX;
232+
if(y[index] < 0)
233+
y[index] = 0;
232234
}
233235
}
234236

0 commit comments

Comments
 (0)