o
    Zh                     @   sr   d dl Z d dlmZ ddlmZ ddlmZmZ e e	Z
edd Zd	d
 ZdddZeedZeded dS )    N)make_boxed_func   )aot_autograd   )register_backendregister_experimental_backendc                 C      t | |ddS )NFboxedxla_backend_helpermodelfake_tensor_inputs r   N/var/www/auris/lib/python3.10/site-packages/torch/_dynamo/backends/torchxla.pyopenxla_eval   s   r   c                 C   r   )NTr	   r   r   r   r   r   openxla_eval_boxed   s   r   Fc              
      s^   zdd l m  m  W n ty } ztd|d }~ww d  fdd}|r-t|S |S )Nr   z_Please follow the instruction in https://github.com/pytorch/xla#pytorchxla to install torch_xlac                     s   d u r  | |  S )N)Zextract_compiled_graph)argsZbridgeZcompiled_graphr   r   r   fwd!   s   zxla_backend_helper.<locals>.fwd)Ztorch_xla.core.dynamo_bridgecoreZdynamo_bridgeImportErrorr   )r   r   r
   er   r   r   r   r      s   r   )Zfw_compileropenxla)nameZcompiler_fn)F)loggingZfunctorch.compiler   Zbackends.commonr   registryr   r   	getLogger__name__logr   r   r   r   r   r   r   r   <module>   s   


