
    ȅi7                     (   % S SK r S SKJr  S SKJr  S SKJr  \r0 q\	\
\\/S4   4   \S'   0 q\	\
\ R                  \   4   \S'   / q\\   \S'   S\4S	 jrS
\S\4S jrS\
S\4S jrS\SS4S jrSS jrS\S\\
\/S4   S\
4S jrS\S\S\
4S jrg)    N)Callable)Any)Sourceindex_to_bytecode_constructor index_to_external_object_weakref
keep_alivereturnc                       [        [        5      $ N)boolr        ]/home/james-whalen/.local/lib/python3.13/site-packages/torch/_dynamo/graph_bytecode_inputs.pyhas_user_objectsr      s    -..r   objc                 0    [         R                  U 5        U $ r   )r   append)r   s    r   stash_graph_created_objectr      s    cJr   indexc                 p    U [         ;   d   S5       e[         U    " 5       nUc   S5       e[         U    " 5       $ )Nz4Index not registered in index_to_user_object_weakrefzUser object is no longer alive)r   )r   r   s     r   get_external_object_by_indexr   !   sH    44 >4 +5
1
3C?<<<?+E244r   argsc            
          [         R                  5         [         R                  [        U 5       VVs0 s H  u  pU[        R
                  " U5      _M     snn5        g s  snnf r   )r   clearupdate	enumerateweakrefref)r   iargs      r   store_user_object_weakrefsr!   *   sE    $**,$+++4T?;?GKK	?;;s   #A
c                  |    [         R                  5         [        R                  5         [        R                  5         g r   )r   r   r   r   r   r   r   reset_user_object_trackingr#   2   s&    !'')$**,r   example_valueconstruct_fnc           	         ^^ [         R                  U 5        [        [        5      mUU4S j[        T'    [        R
                  " U 5      [        T'   T$ ! [         a  nSSKJ	n  U" SSU  3S/ US9   S nAT$ S nAff = f)Nc                    > T" TU 5      $ r   r   )cgr%   r   s    r   <lambda>/register_graph_created_object.<locals>.<lambda>?   s    l5"6Mr      unimplementedz7Failed to make weakref to graph-created external objectuser_object: 0Object does not allow us to make a weakref to itgb_typecontextexplanationhintsfrom_exc)
r   r   lenr   r   r   r   	TypeErrorexcr-   )r$   r%   er-   r   s    `  @r   register_graph_created_objectr:   8   s    
 m$-.E+M!%(
29++m2L(/ L  	
&M#M?3J	
 L	
s   A 
A=A88A=valuesourcec           	         ^ [        [        5      nU4S j[        U'    [        R                  " U 5      [        U'   U$ ! [
         a  nSSKJn  U" SSU  3S/ US9   S nAU$ S nAff = f)Nc                    > U " T5      $ r   r   )r(   r<   s    r   r)   &register_user_object.<locals>.<lambda>S   s	    bjr   r+   r,   z%Failed to make weakref to User Objectr.   r/   r0   )r6   r   r   r   r   r7   r8   r-   )r;   r<   r   r9   r-   s    `   r   register_user_objectr@   P   ss    -.E+@!%(
29++e2D(/ L  	
&;#E7+J	
 L	
s   > 
A&A!!A&)r	   N)r   collections.abcr   typingr   torch._dynamo.sourcer   	PyCodegenr   dictint__annotations__r   ReferenceTyper   listr   r   r   r   r!   r#   r:   r@   r   r   r   <module>rJ      s     $  ' 	 IK tC9+t2C)D$DE JJL  $sG,A,A#,F'F"G L
DI /$ /C C 
5 5 5c d &.Y/?/E&F0 V  r   