elu
elu(x: &Tensor<T>, alpha: C) -> Result<Tensor<C>, TensorError>
Compute for , for for all elements
Parameters:
x: Input values alpha: Parameter controlling the saturation of negative values
Returns:
Tensor with type C
Examples:
use hpt::{ops::FloatUnaryOps, Tensor, error::TensorError};
fn main() -> Result<(), TensorError> {
let a = Tensor::<f32>::new([-1.0]);
let b = a.elu(1.0)?;
println!("{}", b); // prints: -0.6321206
Ok(())
}
Backend Support
| Backend | Supported |
|---|---|
| CPU | ✅ |
| Cuda | ✅ |