swap_linear_with_smooth_fq_linear¶
- torchao.quantization.swap_linear_with_smooth_fq_linear(model, skip_fqn_list=None, cur_fqn='', alpha=0.5) None [source]¶
Replaces linear layers in the model with their SmoothFakeDynamicallyQuantizedLinear equivalents.
- Parameters:
model (torch.nn.Module) – The model containing linear layers to be replaced.
skip_fqn_list (list of str, optional) – List of fully qualified names to skip during replacement. Defaults to None.
cur_fqn (str, optional) – The current fully qualified name of the module being processed. Defaults to “”.
alpha (float, optional) – The scaling factor for SmoothQuant. Defaults to 0.5.
- Returns:
None