Method
add_rms_norm
(
&self,
a: &Tensor,
b: &Tensor,
weight: &Tensor,
eps: f32,
)
Source from the content-addressed store, hash-verified
| 119 | } |
| 120 | |
| 121 | fn add_rms_norm( |
| 122 | &self, |
| 123 | a: &Tensor, |
| 124 | b: &Tensor, |
| 125 | weight: &Tensor, |
| 126 | eps: f32, |
| 127 | ) -> Result<(Tensor, Tensor)> { |
| 128 | let res = (a + b)?; |
| 129 | let normed = candle_nn::ops::rms_norm(&res, weight, eps)?; |
| 130 | Ok((res, normed)) |
| 131 | } |
| 132 | |
| 133 | fn rms_norm_channel(&self, x: &Tensor, weight: &Tensor, eps: f32) -> Result<Tensor> { |
| 134 | // x is (batch, channels, time) — norm over channels at each time step |