e4145441eb
Add initial project files
22 lines
371 B
Rust
22 lines
371 B
Rust
use burn::{
|
|
module::Module,
|
|
tensor::{
|
|
backend::Backend,
|
|
activation::sigmoid,
|
|
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)
|
|
}
|
|
} |