
    9iHX                        d Z ddlZddlZddlmZmZ ddlmZ ddlm	Z	m
Z
 ddlmZmZ ddlmZ ddlmZmZmZmZmZ ddlZd	d
lmZmZmZmZ  e       rddlmZ  G d de      Z d Z!d Z"d Z#d Z$d Z%d Z&d Z'd Z(d Z)d Z*d Z+d Z,d Z-d Z.d Z/d Z0d Z1d Z2d Z3d  Z4 G d! d"e      Z5 e       r:ddl6m7c m8Z9 d#e5d$eee   d%f   fd&Z:d'ee   d(d%d$e5fd)Z; e9jx                  e5e:e;        G d* d+e=e      Z> G d, d-e>      Z? G d. d/e>      Z@ G d0 d1      ZAd2 ZBd3 ZCdAd4ed5e=d6e=fd7ZDe
dBd8eEfd9       ZFdCd:ZGd; ZHdCd<ZId= ZJd> ZKd? ZLd@ ZMy)Dz
Generic utilities
    N)OrderedDictUserDict)MutableMapping)	ExitStackcontextmanager)fieldsis_dataclass)Enum)AnyContextManagerIterableListTuple   )is_flax_availableis_tf_availableis_torch_availableis_torch_fx_proxyc                       e Zd ZdZddZy)cached_propertyz
    Descriptor that mimics @property but caches output in member variable.

    From tensorflow_datasets

    Built-in in functools from Python 3.8.
    Nc                     || S | j                   t        d      d| j                   j                  z   }t        ||d       }|| j                  |      }t	        |||       |S )Nzunreadable attribute	__cached_)fgetAttributeError__name__getattrsetattr)selfobjobjtypeattrcacheds        d/var/www/html/backtest/airagagent/rag_env/lib/python3.12/site-packages/transformers/utils/generic.py__get__zcached_property.__get__-   sg    ;K99 !788TYY///dD)>YYs^FCv&    N)r   
__module____qualname____doc__r$    r%   r#   r   r   $   s    r%   r   c                 R    | j                         } | dv ry| dv ryt        d|       )zConvert a string representation of truth to true (1) or false (0).

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values are 'n', 'no', 'f', 'false', 'off', and '0'.
    Raises ValueError if 'val' is anything else.
    >   1tyonyestruer   >   0fnnoofffalser   zinvalid truth value )lower
ValueError)vals    r#   	strtoboolr;   <   s:     ))+C
22
33
+C73
44r%   c                     t        t        |             }|j                  d      ry|j                  d      ry|j                  d      ry|j                  d      ryy	)
z
    Tries to guess the framework of an object `x` from its repr (brittle but will help in `is_tensor` to try the
    frameworks in a smart order, without the need to import the frameworks).
    z<class 'torch.ptz<class 'tensorflow.tfz<class 'jaxjaxz<class 'numpy.npN)strtype
startswith)xrepresentations     r#   infer_framework_from_reprrF   J   s]    
 a\N  !12		"	"#8	9		"	"=	1		"	"#3	4 
5r%   c                    t         t        t        t        d}t	        |       }|g n|g}|dk7  r|j                  d       |j                  |D cg c]  }||dfvs
| c}       |D ci c]  }|||   
 c}S c c}w c c}w )z
    Returns an (ordered since we are in Python 3.7+) dictionary framework to test function, which places the framework
    we can guess from the repr first, then Numpy, then the others.
    r=   r>   r?   r@   r@   )is_torch_tensoris_tf_tensoris_jax_tensoris_numpy_arrayrF   appendextend)rD   framework_to_testpreferred_framework
frameworksr3   s        r#   _get_frameworks_and_test_funcrR   Z   s     	 4A6*29L8MJd"$"3\QqATVZ@[7[q\]-78A ##88 ]8s   A:A:*A?c                     t        |       }|j                         D ]  } ||       s y t        |       ryt               rddlm} t        | |      ryy)z
    Tests if `x` is a `torch.Tensor`, `tf.Tensor`, `jaxlib.xla_extension.DeviceArray` or `np.ndarray` in the order
    defined by `infer_framework_from_repr`
    Tr   )TracerF)rR   valuesr   r   jax.corerT   
isinstance)rD   framework_to_test_func	test_funcrT   s       r#   	is_tensorrZ   n   sW     ;1=+224 	Q<
 #a r%   c                 6    t        | t        j                        S r&   )rW   r@   ndarrayrD   s    r#   	_is_numpyr^      s    a$$r%   c                     t        |       S )z/
    Tests if `x` is a numpy array or not.
    )r^   r]   s    r#   rL   rL      s     Q<r%   c                 6    dd l }t        | |j                        S Nr   )torchrW   TensorrD   rb   s     r#   	_is_torchre          a&&r%   c                 0    t               sdS t        |       S )z]
    Tests if `x` is a torch tensor or not. Safe to call even if torch is not installed.
    F)r   re   r]   s    r#   rI   rI      s     +,5>)A,>r%   c                 6    dd l }t        | |j                        S ra   )rb   rW   devicerd   s     r#   _is_torch_devicerj      rf   r%   c                 0    t               sdS t        |       S )z]
    Tests if `x` is a torch device or not. Safe to call even if torch is not installed.
    F)r   rj   r]   s    r#   is_torch_devicerl      s     +,5E2B12EEr%   c                     dd l }t        | t              rt        ||       rt	        ||       } nyt        | |j
                        S )Nr   F)rb   rW   rA   hasattrr   dtyperd   s     r#   _is_torch_dtyperp      s9    !S5!q!Aa%%r%   c                 0    t               sdS t        |       S )z\
    Tests if `x` is a torch dtype or not. Safe to call even if torch is not installed.
    F)r   rp   r]   s    r#   is_torch_dtyperr      s     +,5D/!2DDr%   c                 6    dd l }t        | |j                        S ra   )
tensorflowrW   rc   rD   r>   s     r#   _is_tensorflowrv      s    a##r%   c                 0    t               sdS t        |       S )zg
    Tests if `x` is a tensorflow tensor or not. Safe to call even if tensorflow is not installed.
    F)r   rv   r]   s    r#   rJ   rJ      s     ()5@~a/@@r%   c                 t    dd l }t        |d      r|j                  |       S t        |       |j                  k(  S )Nr   is_symbolic_tensor)rt   rn   ry   rB   rc   ru   s     r#   _is_tf_symbolic_tensorrz      s6     r'($$Q''7biir%   c                 0    t               sdS t        |       S )z
    Tests if `x` is a tensorflow symbolic tensor or not (ie. not eager). Safe to call even if tensorflow is not
    installed.
    F)r   rz   r]   s    r#   is_tf_symbolic_tensorr|      s    
 ()5H/Ea/HHr%   c                 :    dd l m} t        | |j                        S ra   )	jax.numpynumpyrW   r\   )rD   jnps     r#   _is_jaxr      s    a%%r%   c                 0    t               sdS t        |       S )zY
    Tests if `x` is a Jax tensor or not. Safe to call even if jax is not installed.
    F)r   r   r]   s    r#   rK   rK      s     *+5;;r%   c                    d d d d d}t        | t        t        f      r-| j                         D ci c]  \  }}|t	        |       c}}S t        | t
        t        f      r| D cg c]  }t	        |       c}S t        |       }|j                         D ]  \  }} ||       s ||   |       c S  t        | t        j                        r| j                         S | S c c}}w c c}w )zc
    Convert a TensorFlow tensor, PyTorch tensor, Numpy array or python list to a python list.
    c                 Z    | j                         j                         j                         S r&   )detachcputolistr   s    r#   <lambda>zto_py_obj.<locals>.<lambda>   s    #**,**,335 r%   c                 >    | j                         j                         S r&   )r   r   r   s    r#   r   zto_py_obj.<locals>.<lambda>   s    #))+,,. r%   c                 H    t        j                  |       j                         S r&   )r@   asarrayr   r   s    r#   r   zto_py_obj.<locals>.<lambda>   s    2::c?113 r%   c                 "    | j                         S r&   )r   r   s    r#   r   zto_py_obj.<locals>.<lambda>   s    #**, r%   rH   )rW   dictr   items	to_py_objlisttuplerR   r@   numberr   )r   framework_to_py_objkvorX   	frameworkrY   s           r#   r   r      s     6.3&	 #h'(,/IIK8DAq9Q<88	C$	'&)*	!** ;3? 6 < < > 7	9S>1&y1#667
 #ryy!zz|
 9*s   C")C(c                 t   d d d d d}t        | t        t        f      r-| j                         D ci c]  \  }}|t	        |       c}}S t        | t
        t        f      rt        j                  |       S t        |       }|j                         D ]  \  }} ||       s ||   |       c S  | S c c}}w )zc
    Convert a TensorFlow tensor, PyTorch tensor, Numpy array or python list to a Numpy array.
    c                 Z    | j                         j                         j                         S r&   )r   r   r   r   s    r#   r   zto_numpy.<locals>.<lambda>  s    #**,**,224 r%   c                 "    | j                         S r&   )r   r   s    r#   r   zto_numpy.<locals>.<lambda>  s    #))+ r%   c                 ,    t        j                  |       S r&   )r@   r   r   s    r#   r   zto_numpy.<locals>.<lambda>  s    2::c? r%   c                     | S r&   r*   r   s    r#   r   zto_numpy.<locals>.<lambda>  s    # r%   rH   )
rW   r   r   r   to_numpyr   r   r@   arrayrR   )r   framework_to_numpyr   r   rX   r   rY   s          r#   r   r     s     5%*	 #h'(+.99;741a8A;77	C$	'xx} ;3? 6 < < > 6	9S>0%i0556 J 8s   B4c                   ~     e Zd ZdZddZ fdZd Zd Zd Zd Z	d	 Z
d
 Z fdZ fdZ fdZdee   fdZ xZS )ModelOutputa  
    Base class for all model outputs as dataclass. Has a `__getitem__` that allows indexing by integer or slice (like a
    tuple) or strings (like a dictionary) that will ignore the `None` attributes. Otherwise behaves like a regular
    python dictionary.

    <Tip warning={true}>

    You can't unpack a `ModelOutput` directly. Use the [`~utils.ModelOutput.to_tuple`] method to convert it to a tuple
    before.

    </Tip>
    returnc                 X    t               r t        j                  | t        t               yy)zRegister subclasses as pytree nodes.

        This is necessary to synchronize gradients when using `torch.nn.parallel.DistributedDataParallel` with
        `static_graph=True` with modules that output `ModelOutput` subclasses.
        N)r   _torch_pytree_register_pytree_node_model_output_flatten_model_output_unflatten)clss    r#   __init_subclass__zModelOutput.__init_subclass__.  s&     //%'  r%   c                     t        |   |i | | j                  t        k7  }|r;t	        |       s/t        | j                   d| j                  j                   d      y y )N.za is not a dataclasss. This is a subclass of ModelOutput and so must use the @dataclass decorator.)super__init__	__class__r   r	   	TypeErrorr'   r   )r   argskwargsis_modeloutput_subclassr   s       r#   r   zModelOutput.__init__;  sl    $)&) #'..K"?"<+=??#1T^^%<%<$= >_ _  ,>"r%   c                     t               }t        |      s"t         j                  j                   d      t        d |dd D              s"t         j                  j                   d      t         |d   j                        }t         fd|dd D              }|rt        |      st        |t              r|j                         }d}n	 t        |      }d}|rt              D ]  \  }}t        |t        t         f      r!t        |      d
k(  rt        |d   t"              s)|dk(  r| |d   j                  <   nt        d| d       yt%         |d   |d          |d   |d    |d   <    y|| |d   j                  <   yy|D ]*  }t         |j                        }	|	|	 |j                  <   , y# t        $ r d	}Y w xY w)zeCheck the ModelOutput dataclass.

        Only occurs if @dataclass decorator has been used.
        z has no fields.c              3   8   K   | ]  }|j                   d u   y wr&   )default).0fields     r#   	<genexpr>z,ModelOutput.__post_init__.<locals>.<genexpr>T  s     GU5==D(Gs   r   Nz. should not have more than one required field.r   c              3   N   K   | ]  }t        |j                        d u   y wr&   r   namer   r   r   s     r#   r   z,ModelOutput.__post_init__.<locals>.<genexpr>X  s!     #d%GD%**$=$E#ds   "%TF   zCannot set key/value for z&. It needs to be a tuple (key, value).)r   lenr9   r   r   allr   r   rZ   rW   r   r   iterr   	enumerater   r   rA   r   )
r   class_fieldsfirst_fieldother_fields_are_noneiteratorfirst_field_iteratoridxelementr   r   s
   `         r#   __post_init__zModelOutput.__post_init__J  s   
 d| <  7 78HIIGl126FGG 7 788fghhdLO$8$89 ##dS_`a`bSc#d d ;)?+t,&,,.'+$1#K0H+/( $$-h$7 6LC&wu>"7|q0)'!*c:!89DDa!5!56 #-";G9Dj k#  D'!*gaj9qz-+21:WQZ(#6$ (-8\!_))* ) & )D%**-='(D$)7 ! 1+0(1s   F? ?GGc                 H    t        d| j                  j                   d      )Nz$You cannot use ``__delitem__`` on a 
 instance.	Exceptionr   r   r   r   r   s      r#   __delitem__zModelOutput.__delitem__  s#    >t~~?V?V>WWabccr%   c                 H    t        d| j                  j                   d      )Nz#You cannot use ``setdefault`` on a r   r   r   s      r#   
setdefaultzModelOutput.setdefault  s#    =dnn>U>U=VV`abbr%   c                 H    t        d| j                  j                   d      )NzYou cannot use ``pop`` on a r   r   r   s      r#   popzModelOutput.pop  s"    6t~~7N7N6OzZ[[r%   c                 H    t        d| j                  j                   d      )NzYou cannot use ``update`` on a r   r   r   s      r#   updatezModelOutput.update  s#    9$..:Q:Q9RR\]^^r%   c                     t        |t              rt        | j                               }||   S | j	                         |   S r&   )rW   rA   r   r   to_tuple)r   r   
inner_dicts      r#   __getitem__zModelOutput.__getitem__  s7    adjjl+Ja= ==?1%%r%   c                 n    || j                         v r|t        | 	  ||       t        |   ||       y r&   )keysr   __setitem____setattr__)r   r   valuer   s      r#   r   zModelOutput.__setattr__  s4    499;5#4Ge,D%(r%   c                 F    t         |   ||       t         | 	  ||       y r&   )r   r   r   )r   keyr   r   s      r#   r   zModelOutput.__setitem__  s!    C'C'r%   c                      t               st         	         S t         	         ^}}}t         fdt	               D              }||g|S )Nc              3   J   K   | ]  }t        |j                          y wr&   r   r   s     r#   r   z)ModelOutput.__reduce__.<locals>.<genexpr>  s     I5WT5::.Is    #)r	   r   
__reduce__r   r   )r   callable_args	remainingr   r   s   `    r#   r   zModelOutput.__reduce__  sQ    D!7%''&+g&8&:#%)IF4LII)	))r%   c                 H     t         fd j                         D              S )za
        Convert self to a tuple containing all the attributes/keys that are not `None`.
        c              3   (   K   | ]	  }|     y wr&   r*   )r   r   r   s     r#   r   z'ModelOutput.to_tuple.<locals>.<genexpr>  s     2T!W2s   )r   r   )r   s   `r#   r   zModelOutput.to_tuple  s     2diik222r%   )r   N)r   r'   r(   r)   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __classcell__)r   s   @r#   r   r      sT    6)pdc\_&)(*3%* 3r%   r   outputr   z_torch_pytree.Contextc                 |    t        | j                               t        |       t        | j                               ffS r&   )r   rU   rB   r   )r   s    r#   r   r     s,    FMMO$tF|T&++-5H&IIIr%   rU   contextc           
      B    |\  }} |di t        t        ||             S )Nr*   )r   zip)rU   r   output_typer   s       r#   r   r     s&    #T5T#dF"3455r%   c                        e Zd ZdZed        Zy)ExplicitEnumzC
    Enum with more explicit error message for missing values.
    c           
      ~    t        | d| j                   dt        | j                  j	                                      )Nz is not a valid z, please select one of )r9   r   r   _value2member_map_r   )r   r   s     r#   	_missing_zExplicitEnum._missing_  s?    g%cll^3J4PSPfPfPkPkPmKnJop
 	
r%   N)r   r'   r(   r)   classmethodr   r*   r%   r#   r   r     s     
 
r%   r   c                       e Zd ZdZdZdZdZy)PaddingStrategyz
    Possible values for the `padding` argument in [`PreTrainedTokenizerBase.__call__`]. Useful for tab-completion in an
    IDE.
    longest
max_length
do_not_padN)r   r'   r(   r)   LONGEST
MAX_LENGTH
DO_NOT_PADr*   r%   r#   r   r     s    
 GJJr%   r   c                        e Zd ZdZdZdZdZdZy)
TensorTypez
    Possible values for the `return_tensors` argument in [`PreTrainedTokenizerBase.__call__`]. Useful for
    tab-completion in an IDE.
    r=   r>   r@   r?   N)r   r'   r(   r)   PYTORCH
TENSORFLOWNUMPYJAXr*   r%   r#   r   r     s    
 GJE
Cr%   r   c                   .    e Zd ZdZdee   fdZd Zd Zy)ContextManagersz
    Wrapper for `contextlib.ExitStack` which enters a collection of context managers. Adaptation of `ContextManagers`
    in the `fastcore` library.
    context_managersc                 0    || _         t               | _        y r&   )r  r   stack)r   r  s     r#   r   zContextManagers.__init__  s     0[
r%   c                 \    | j                   D ]  }| j                  j                  |        y r&   )r  r	  enter_context)r   context_managers     r#   	__enter__zContextManagers.__enter__  s)    #44 	6OJJ$$_5	6r%   c                 <     | j                   j                  |i | y r&   )r	  __exit__r   s      r#   r  zContextManagers.__exit__  s    

T,V,r%   N)	r   r'   r(   r)   r   r   r   r  r  r*   r%   r#   r  r    s"    
!n)= !6-r%   r  c                 T   t        |       }|dk(  r t        j                  | j                        }nD|dk(  r t        j                  | j                        }nt        j                  | j
                        }|j                  D ]%  }|dk(  s	|j                  |   j                  du s% y y)zr
    Check if a given model can return loss.

    Args:
        model_class (`type`): The class of the model.
    r>   r=   return_lossTF)infer_frameworkinspect	signaturecallforward__call__
parametersr   )model_classr   r  ps       r#   can_return_lossr    s      ,ID%%k&6&67		d	%%k&9&9:	%%k&:&:;	!! )"6"6q"9"A"AT"I r%   c                    | j                   }t        |       }|dk(  r t        j                  | j                        }nD|dk(  r t        j                  | j
                        }nt        j                  | j                        }d|v r#|j                  D cg c]  }d|v s|dv s| c}S |j                  D cg c]	  }d|v s| c}S c c}w c c}w )zq
    Find the labels used by a given model.

    Args:
        model_class (`type`): The class of the model.
    r>   r=   QuestionAnsweringlabel)start_positionsend_positions)r   r  r  r  r  r  r  r  )r  
model_namer   r  r  s        r#   find_labelsr"    s     %%J,ID%%k&6&67		d	%%k&9&9:	%%k&:&:;	j($//ma7a<1HlClmm$//@a7a<@@ n@s   C!C6	C Cd
parent_key	delimiterc                 0    dd}t         || ||            S )z/Flatten a nested dict into a single level dict.c              3      K   | j                         D ]`  \  }}|rt        |      |z   t        |      z   n|}|r5t        |t              r%t	        |||      j                         E d {    [||f b y 7 w)N)r%  )r   rA   rW   r   flatten_dict)r#  r$  r%  r   r   r   s         r#   _flatten_dictz#flatten_dict.<locals>._flatten_dict$  sp     GGI 	DAq:D#j/I-A6!CZ>2'3)DJJLLL1f	 Ms   A&A9(A7)A9 r   )r   )r#  r$  r%  r)  s       r#   r(  r(  !  s     aY788r%   use_temp_dirc              #   t   K   |r"t        j                         5 }| d d d        y |  y # 1 sw Y   y xY wwr&   )tempfileTemporaryDirectory)working_dirr,  tmp_dirs      r#   working_or_temp_dirr2  /  s=     ((* 	gM	 	 	 	s   8,858c                 N   t        |       rt        j                  | |      S t        |       r|| j                  S  | j
                  | S t        |       rddl}|j                  | |      S t        |       rt        j                  | |      S t        dt        |        d      )z
    Framework-agnostic version of `numpy.transpose` that will work on torch/TensorFlow/Jax tensors as well as NumPy
    arrays.
    )axesNr   )permz"Type not supported for transpose: r   )rL   r@   	transposerI   TpermuterJ   rt   rK   r   r9   rB   )r   r4  r>   s      r#   r6  r6  8  s    
 e||E--		,uww@MEMM4,@@	e	||E|--	u	}}U..=d5k]!LMMr%   c                 ,   t        |       rt        j                  | |      S t        |       r | j                  | S t	        |       rddl}|j                  | |      S t        |       rt        j                  | |      S t        dt        |        d      )z
    Framework-agnostic version of `numpy.reshape` that will work on torch/TensorFlow/Jax tensors as well as NumPy
    arrays.
    r   Nz Type not supported for reshape: r   )
rL   r@   reshaperI   rJ   rt   rK   r   r9   rB   )r   newshaper>   s      r#   r:  r:  K  s    
 ezz%**		u}}h''	e	zz%**	u	{{5(++;DK=JKKr%   c                 \   t        |       rt        j                  | |      S t        |       r$|| j                         S | j                  |      S t	        |       rddl}|j                  | |      S t        |       rt        j                  | |      S t        dt        |        d      )z
    Framework-agnostic version of `numpy.squeeze` that will work on torch/TensorFlow/Jax tensors as well as NumPy
    arrays.
    axisNdimr   z Type not supported for squeeze: r   )
rL   r@   squeezerI   rJ   rt   rK   r   r9   rB   r   r>  r>   s      r#   rA  rA  ^  s    
 ezz%d++		"&,u}}KEMMdM4KK	e	zz%dz++	u	{{5t,,;DK=JKKr%   c                 6   t        |       rt        j                  | |      S t        |       r| j	                  |      S t        |       rddl}|j                  | |      S t        |       rt        j                  | |      S t        dt        |        d      )z
    Framework-agnostic version of `numpy.expand_dims` that will work on torch/TensorFlow/Jax tensors as well as NumPy
    arrays.
    r?  r   Nr=  $Type not supported for expand_dims: r   )rL   r@   expand_dimsrI   	unsqueezerJ   rt   rK   r   r9   rB   rB  s      r#   rE  rE  q  s    
 e~~eT**		4((	e	~~e$~//	u	u400?U}ANOOr%   c                    t        |       rt        j                  |       S t        |       r| j	                         S t        |       rddl}|j                  |       S t        |       r| j                  S t        dt        |        d      )z|
    Framework-agnostic version of `numpy.size` that will work on torch/TensorFlow/Jax tensors as well as NumPy arrays.
    r   NrD  r   )
rL   r@   sizerI   numelrJ   rt   rK   r9   rB   )r   r>   s     r#   tensor_sizerJ    sr     ewwu~		{{}	e	wwu~	u	zz?U}ANOOr%   c                     | j                         D ]N  \  }}t        |t        t        f      r!|D cg c]  }|d|vr| d| n| c}| |<   =|@d|vsE| d| | |<   P | S c c}w )zB
    Adds the information of the repo_id to a given auto map.
    z--)r   rW   r   r   )auto_maprepo_idr   r   r   s        r#   add_model_info_to_auto_maprN    s     nn& 2
UeeT]+dij_`1=TQR]y1#.YZZjHSM4u#4&ir%1HSM	2 O	 ks   A$c                 X   t        j                  |       D ]  }|j                  }|j                  }|j	                  d      s|j	                  d      s|dk(  r y|j	                  d      s|dk(  r y|j	                  d      s|j	                  d	      s|d
k(  s y t        d|  d      )z
    Infers the framework of a given model without using isinstance(), because we cannot guarantee that the relevant
    classes are imported or available.
    rt   kerasTFPreTrainedModelr>   rb   PreTrainedModelr=   flaxr?   FlaxPreTrainedModelz%Could not infer framework from class r   )r  getmror'   r   rC   r   )r  
base_classmoduler   s       r#   r  r    s    
 nn[1 
P
&&""\*f.?.?.HDTgLgw'43D+Dv&&*;*;E*BdNcFc
P ?}ANOOr%   r*  )Fr&   )Nr)   r  r.  collectionsr   r   collections.abcr   
contextlibr   r   dataclassesr   r	   enumr
   typingr   r   r   r   r   r   r@   import_utilsr   r   r   r   r~   r   propertyr   r;   rF   rR   rZ   r^   rL   re   rI   rj   rl   rp   rr   rv   rJ   rz   r|   r   rK   r   r   r   torch.utils._pytreeutils_pytreer   r   r   r   rA   r   r   r   r  r  r"  r(  boolr2  r6  r:  rA  rE  rJ  rN  r  r*   r%   r#   <module>rd     s     - * 0 ,  = =  c c h 05 9(0%'?'F&E$A I&<<4L3+ L3^ //Jk JeDIG^<^6_ J6 6@W 6\g 6 (M''	
3 	
l 	 	- -$,A,9N 9 9S 9 4  N&L&L&P&P$
Pr%   