mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 03:54:56 +00:00
Add leaky-relu in the activation enum. (#858)
This commit is contained in:
@ -10,6 +10,7 @@ pub enum Activation {
|
|||||||
NewGelu,
|
NewGelu,
|
||||||
Relu,
|
Relu,
|
||||||
Elu(f64),
|
Elu(f64),
|
||||||
|
LeakyRelu(f64),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl super::Module for Activation {
|
impl super::Module for Activation {
|
||||||
@ -22,6 +23,7 @@ impl super::Module for Activation {
|
|||||||
Self::NewGelu => xs.gelu(),
|
Self::NewGelu => xs.gelu(),
|
||||||
Self::Relu => xs.relu(),
|
Self::Relu => xs.relu(),
|
||||||
&Self::Elu(alpha) => xs.elu(alpha),
|
&Self::Elu(alpha) => xs.elu(alpha),
|
||||||
|
&Self::LeakyRelu(negative_slope) => crate::ops::leaky_relu(xs, negative_slope),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user