(self, x)
| 282 | self.register_parameter('scale_to_int', None) |
| 283 | |
| 284 | def forward(self, x): |
| 285 | weight = None if self.weight is None else self.weight.value |
| 286 | bias = None if self.bias is None else self.bias.value |
| 287 | scale = None if self.scale_to_int is None else self.scale_to_int.value |
| 288 | return smooth_quant_layer_norm( |
| 289 | x, |
| 290 | self.normalized_shape, |
| 291 | weight, |
| 292 | bias, |
| 293 | scale, |
| 294 | self.eps, |
| 295 | dynamic_act_scaling=self.quant_mode.has_per_token_dynamic_scaling()) |
| 296 | |
| 297 | |
| 298 | class SmoothQuantRmsNorm(Module): |