
    `i                     J    d dl Z d dlZd dlmZ dZdee         dededefdZdS )	    N)CallablezMUsage of '{old_location}' is deprecated; please use '{new_location}' instead.all
old_module
new_modulereturnc                 f     t                               |          dt          ddf fd}|S )a@  Import utility to lazily import deprecated packages / modules / functional.

    The old_module and new_module are also used in the deprecation warning defined
    by the `_MESSAGE_TEMPLATE`.

    Args:
        all: The list of the functions that are imported. Generally, the module's
            __all__ list of the module.
        old_module: Old module location
        new_module: New module location / Migrated location

    Returns:
        Callable to assign to the `__getattr__`

    Usage:

        # In the `torch/nn/quantized/functional.py`
        from torch.nn.utils._deprecation_utils import lazy_deprecated_import
        _MIGRATED_TO = "torch.ao.nn.quantized.functional"
        __getattr__ = lazy_deprecated_import(
            all=__all__,
            old_module=__name__,
            new_module=_MIGRATED_TO)
    )old_locationnew_locationnamer   Nc                     | v r>t          j        t                     t          j                  }t          ||           S t          dd| d          )NzModule z has no attribute .)warningswarnRuntimeWarning	importlibimport_modulegetattrAttributeError)r   packager   r   warning_messages     u/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/torch/nn/utils/_deprecation_utils.pygetattr_dunderz.lazy_deprecated_import.<locals>.getattr_dunder,   sb    3;; M/>:::-j99G7D)))PzPPtPPPQQQ    )_MESSAGE_TEMPLATEformatstr)r   r   r   r   r   s   ` ` @r   lazy_deprecated_importr      sn    : (..j /  ORS RT R R R R R R R R r   )r   r   typingr   r   listr   r    r   r   <module>r!      s}               U 
*	c** * 	* * * * * *r   