Skip to main content

smooth_sign

Function smooth_sign 

Source
pub fn smooth_sign(x: &Tensor, alpha: f64) -> Result<Tensor>
Expand description

Apply SmoothSign (sign forward with zero mapped to +1, derivative alpha * (1 - tanh(alpha * x)^2) backward).

ยงErrors

Returns an error if the tensor dtype is unsupported or an internal Candle op fails.