U
    zh                     @   s   d Z ddlZdddZdS )za
APIs related to torch.compile which lazily import torch._dynamo to avoid
circular dependencies.
    NTc                    s6    dk	r$t   fdd}|S t jtdS dS )au  
    This API should be only used inside torch, external users should still use
    torch._dynamo.disable. The main goal of this API is to avoid circular
    imports issues that is common while using _dynamo.disable inside torch
    itself.

    This API avoids it by lazily importing torch._dynamo from the import time to
    the invocation of the decorated function.
    Nc                     s:   t  dd }|d kr0dd l}|j }| _|| |S )N__dynamo_disabler   )getattrZtorch._dynamoZ_dynamodisabler   )argskwargsZ
disable_fnZtorchfn	recursive @/var/www/html/venv/lib/python3.8/site-packages/torch/_compile.pyinner   s    z_disable_dynamo.<locals>.inner)r	   )	functoolswrapspartial_disable_dynamo)r   r	   r   r
   r   r   r   	   s
    
r   )NT)__doc__r   r   r
   r
   r
   r   <module>   s   