Burn-readme-1.rs
· 139 B · Rust
Sin formato
fn gelu_custom<B: Backend, const D: usize>(x: Tensor<B, D>) -> Tensor<B, D> {
let x = x.clone() * ((x / SQRT_2).erf() + 1);
x / 2
}
1 | fn gelu_custom<B: Backend, const D: usize>(x: Tensor<B, D>) -> Tensor<B, D> { |
2 | let x = x.clone() * ((x / SQRT_2).erf() + 1); |
3 | x / 2 |
4 | } |