1 2 3 4 5 6 7 8 9 10 11 12
use crate::rotta_rs_module::{ matmul, Tensor }; pub struct Linear { pub weight: Tensor, pub bias: Tensor, } impl Linear { pub fn forward(&self, x: &Tensor) -> Tensor { &matmul(x, &self.weight) + &self.bias } }