This commit is contained in:
Louis Fortier-Dubois 2023-08-30 10:00:50 -04:00 committed by GitHub
parent 7c34e21424
commit f253f19b4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -389,10 +389,7 @@ impl<F: FloatCandleElement, I: IntCandleElement> TensorOps<CandleBackend<F, I>>
}
fn tanh<const D: usize>(tensor: FloatTensor<Self, D>) -> FloatTensor<Self, D> {
// TODO submit an issue at Candle
let e_x = tensor.tensor.exp().unwrap();
let e_minus_x = tensor.tensor.neg().unwrap().exp().unwrap();
CandleTensor::new(((e_x.clone() - e_minus_x.clone()).unwrap() / (e_x + e_minus_x)).unwrap())
CandleTensor::new(tensor.tensor.tanh().unwrap())
}
fn erf<const D: usize>(tensor: FloatTensor<Self, D>) -> FloatTensor<Self, D> {