mirror of
https://github.com/huggingface/candle.git
synced 2025-06-18 11:37:11 +00:00
Add leaky-relu in the activation enum. (#858)
This commit is contained in:
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user