def inline_and_annotate_module(
    model: ScriptModule,
    name_prefix: str = "var",
) -> TorchScriptModuleAnnotator:
    """
    Inlines and annotates a TorchScript module.

    This function takes a TorchScript module and performs two operations:
        1. Inlining: It inlines the module, which means it replaces calls to submodules
        with the actual operations performed by those submodules.
        
        2. Annotation: It adds annotations to the module, providing additional
        information about the module's structure and operations.

    Parameters
    ----------
    model : ScriptModule
        The TorchScript module to be inlined and annotated. This should be an
        instance of ScriptModule, which is a subclass of torch.nn.Module
        that has been scripted using torch.jit.script().

    Returns
    -------
    TorchScriptModuleAnnotator
        An annotator object that contains the inlined and annotated version of
        the input module.
    """
    annotator = TorchScriptModuleAnnotator(name_prefix=name_prefix)
    inliner = _TorchScriptModuleInliner(
        module=model,
        annotator=annotator,
    )
    inliner.inline()

    return annotator

    Inlines and annotates a TorchScript module.

    This function takes a TorchScript module and performs two operations:
        1. Inlining: It inlines the module, which means it replaces calls to submodules
        with the actual operations performed by those submodules.
        
        2. Annotation: It adds annotations to the module, providing additional
        information about the module's structure and operations.

    Parameters
    ----------
    model : ScriptModule
        The TorchScript module to be inlined and annotated. This should be an
        instance of ScriptModule, which is a subclass of torch.nn.Module
        that has been scripted using torch.jit.script().

    Returns
    -------
    TorchScriptModuleAnnotator
        An annotator object that contains the inlined and annotated version of
        the input module.
    
coremltools/models/ml_program/experimental/torch/debugging_utils.py