
    sg                         d dl Z d dlmZ ddlmZ ddlmZmZ  e j                  e	      Z
ed        Zd Zdd	Z ee
      Z ede       y)    N)make_boxed_func   )aot_autograd   )register_backendregister_experimental_backendc                     t        | |d      S )NFboxedxla_backend_helpermodelfake_tensor_inputss     R/var/www/html/venv/lib/python3.12/site-packages/torch/_dynamo/backends/torchxla.pyopenxla_evalr      s    e%7uEE    c                     t        | |d      S )NTr
   r   r   s     r   openxla_eval_boxedr      s    e%7tDDr   c                      	 dd l mc m d  fd}|rt	        |      S |S # t        $ r}t        d      |d }~ww xY w)Nr   z_Please follow the instruction in https://github.com/pytorch/xla#pytorchxla to install torch_xlac                  8    j                  |        |  S )N)extract_compiled_graph)argsbridgecompiled_graphr   s    r   fwdzxla_backend_helper.<locals>.fwd!   s+     !#::5$GNt$$r   )torch_xla.core.dynamo_bridgecoredynamo_bridgeImportErrorr   )r   r   r   er   r   r   s   `    @@r   r   r      sS    55 N% $)?31c1  m
	s   	& 	A ;A )fw_compileropenxla)namecompiler_fn)F)loggingfunctorch.compiler   backends.commonr   registryr   r   	getLogger__name__logr   r   r   r#    r   r   <module>r.      sc     - * E g! F FE2* " iW 5r   