Skip to content

Commit f5feb1c

Browse files
committed
ReLU kernel: never output -0.0
1 parent 4d60c7a commit f5feb1c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

thinc/backends/cpu_kernels.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ void cpu_relu(A* X, L N)
271271
static_assert(std::is_integral<L>::value, "Array length should be integral");
272272

273273
for (L i = 0; i < N; ++i) {
274-
if (X[i] < 0) {
274+
if (X[i] <= 0.0) {
275275
X[i] = 0.0;
276276
}
277277
}

0 commit comments

Comments
 (0)