
    Ph                        d dl Z 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ed        Zed	        Zd
 ZddZ ee      Z ede        ee      Z ede        ee      Z ede       y)    N)make_boxed_func   )aot_autograd   )register_backendregister_experimental_backendc                     | S N )gmfake_tensor_inputss     jC:\Users\daisl\Desktop\realtime-object-detection\venv\Lib\site-packages\torch/_dynamo/backends/torchxla.pytorchxla_trivialr      s    I    c                 D    t        j                  d       t        | |      S )NzLThis backend will be deprecated in 2.2, please use `openxla` backend instead)warningswarnxla_backend_helpermodelr   s     r   torchxla_trace_oncer      s!    MMV e%788r   c                     t        | |d      S )NFboxedr   r   s     r   openxla_evalr      s    e%7uEEr   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 r
   )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aot_torchxla_trivial)namecompiler_fnaot_torchxla_trace_onceopenxla)F)loggingr   functorch.compiler   backends.commonr   registryr   r   	getLogger__name__logr   r   r   r   r   r,   r/   r0   r   r   r   <module>r8      s      - * Eg!   9 9 F FE2* $   	-A '#  	"0G " iW 5r   