(&self, weight: &Tensor)
| 357 | fn device(&self) -> &Device { &self.device } |
| 358 | |
| 359 | fn preprocess_linear_weight(&self, weight: &Tensor) -> Result<Tensor> { |
| 360 | // Pre-ensure contiguous layout at load time to avoid runtime copies. |
| 361 | // Don't change dtype — linear_forward expects matching dtypes with input. |
| 362 | if weight.is_contiguous() { Ok(weight.clone()) } else { weight.contiguous() } |
| 363 | } |
| 364 | |
| 365 | fn matmul(&self, a: &Tensor, b: &Tensor) -> Result<Tensor> { |
| 366 | let orig = a.dtype(); |