From 0633c85514891141f5d8ded4e1a935ca430c97fe Mon Sep 17 00:00:00 2001 From: Laurent Mazare Date: Fri, 15 Sep 2023 08:05:38 +0200 Subject: [PATCH] Add leaky-relu in the activation enum. (#858) --- candle-nn/src/activation.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/candle-nn/src/activation.rs b/candle-nn/src/activation.rs index 22e062b0..17467b31 100644 --- a/candle-nn/src/activation.rs +++ b/candle-nn/src/activation.rs @@ -10,6 +10,7 @@ pub enum Activation { NewGelu, Relu, Elu(f64), + LeakyRelu(f64), } impl super::Module for Activation { @@ -22,6 +23,7 @@ impl super::Module for Activation { Self::NewGelu => xs.gelu(), Self::Relu => xs.relu(), &Self::Elu(alpha) => xs.elu(alpha), + &Self::LeakyRelu(negative_slope) => crate::ops::leaky_relu(xs, negative_slope), } } }