def _attach_smooth_quant_scaling_factor_to_model(module):
    """
    Get scaling factors for SmoothQuant from observers and
    store them in qstate
    """
    if not hasattr(module, "_auto_quant_state"):
        return
    qstate = module._auto_quant_state
    qconfig = qstate.qconfig
    if not isinstance(
        qconfig.activation(), SmoothQuantActivationObserver
    ) or not isinstance(qconfig.weight(), SmoothQuantWeightObserver):
        return
    if not qstate.tensor_id_to_observer:
        return
    for key, obs in qstate.tensor_id_to_observer.items():
        if key in qstate.tensor_id_to_smooth_quant_scaling_factor:
            continue
        scaling_factors = obs.get_scaling_factors()
        qstate.tensor_id_to_smooth_quant_scaling_factor[key] = scaling_factors

    for key, obs in qstate.weight_tensor_id_to_observer.items():
        if key in qstate.weight_tensor_id_to_smooth_quant_scaling_factor:
            continue
        scaling_factors = obs.get_scaling_factors()
        qstate.weight_tensor_id_to_smooth_quant_scaling_factor[key] = scaling_factors

    Get scaling factors for SmoothQuant from observers and
    store them in qstate
    
intel_extension_for_pytorch/quantization/_utils.py