def find_target(model, target_name):
    """
    Finds the module in model which is referenced by the target_name.
    target_name is in the form of `mod_a.mod_b.mod_c`
    """
    current_obj = model
    for attr in target_name.split("."):
        current_obj = getattr(current_obj, attr)
    return current_obj

    Finds the module in model which is referenced by the target_name.
    target_name is in the form of `mod_a.mod_b.mod_c`
    
coremltools/optimize/torch/quantization/_utils.py