From 844d45cde4c5068fc45aaebd5858c8370a93ca20 Mon Sep 17 00:00:00 2001 From: Laurent Mazare Date: Sat, 21 Sep 2024 15:03:19 +0200 Subject: Bugfix for the metal elu kernel. (#2490) * Bugfix for the metal elu kernel. * Add a test. --- candle-metal-kernels/src/affine.metal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'candle-metal-kernels') diff --git a/candle-metal-kernels/src/affine.metal b/candle-metal-kernels/src/affine.metal index cbbb03e2..e5229f55 100644 --- a/candle-metal-kernels/src/affine.metal +++ b/candle-metal-kernels/src/affine.metal @@ -105,7 +105,7 @@ kernel void FN_NAME##_strided( \ return; \ } \ const TYPENAME x = input[get_strided_index(id, num_dims, dims, strides)]; \ - output[id] = TYPENAME((x > 0)?x: mul * exp(x - 1)); \ + output[id] = TYPENAME((x > 0)?x: mul * (exp(x) - 1)); \ } \ -- cgit v1.2.3