1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use burn::{
    module::Module,
    tensor::{activation::sigmoid, backend::Backend, Tensor},
};

#[derive(Module, Clone, Debug)]
pub struct SILU {}

impl SILU {
    pub fn new() -> Self {
        Self {}
    }

    pub fn forward<B: Backend, const D: usize>(&self, x: Tensor<B, D>) -> Tensor<B, D> {
        x.clone() * sigmoid(x)
    }
}