
    uki                        U d dl mZ d dlZd dlmZ d dlZd ZdededdfdZdedede	fd	Z
e G d
 d             Zi Zeeef   ed<   deddfdZdeddfdZdeddfdZdede	fdZdedededdfdZ ed        ed        ed        ed        ed        ed        ed        ed        ed        ed        ed        ed         ed!       y)"    )	dataclassN)
ModuleTypec                 <     t         j                   fd       }|S )Nc                     | v r3|    \  }}|t        |      t        j                  |t        d       |S t        dd|       )N   )
stacklevelzmodule z has no attribute )AttributeErrorwarningswarnDeprecationWarning)namemessagefndeprecationsmodules      P/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/jax/_src/deprecations.pygetattrz$deprecation_getattr.<locals>.getattr1   sX    | &kgr	W%%mmG/A>i
76*,>thG
HH    )	functoolscache)r   r   r   s   `` r   deprecation_getattrr   0   s"    ??I I 
.r   r   r   returnc                 J    | j                   |   \  }}|df| j                   |<   y)zAccelerate the deprecation of a module-level attribute.

  Raises an AttributeError instead of a DeprecationWarning upon attribute access.
  Used in Google-internal code to implement faster deprecation.
  N_deprecations)r   r   r   _s       r   accelerate_getattr_deprecationr   >   s,     ##D)*'1 '&tr   c                 *    | j                   |   d   du S )zqReturns true if given name is accelerated.

  Raises an error if name is not a deprecated attribute in module.
     Nr   )r   r   s     r   is_accelerated_attributer    G   s    
 
		d	#A	&$	..r   c                       e Zd ZU dZeed<   y)DeprecationStateFacceleratedN)__name__
__module____qualname__r#   bool__annotations__ r   r   r"   r"   V   s    +tr   r"   _registered_deprecationsdeprecation_idc                 &    t               t        | <   y )N)r"   r*   r+   s    r   registerr.   ]   s    -=-?>*r   c                 \    | t         vrt        d| d      t         j                  |        y Ndeprecation_id= not registered.)r*   
ValueErrorpopr-   s    r   
unregisterr5   a   s/    33
**:;
<<~.r   c                 N    | t         vrt        d| d      dt         |    _        y )Nr1   r2   Tr*   r3   r#   r-   s    r   
accelerater8   g   s/    33
**:;
<<9=>*6r   c                 V    | t         vrt        d| d      t         |    j                  S r0   r7   r-   s    r   is_acceleratedr:   m   s2    33
**:;
<<	!.	1	=	==r   r   r   c                 n    t        |       rt        |      t        j                  |t        |dz          y)zGWarns about a deprecation, or errors if the deprecation is accelerated.r   )categoryr   N)r:   r3   r
   r   r   )r+   r   r   s      r   r   r   s   s-    N#
W
MM'$6'!^-r   zdefault-dtype-bits-configzjax-checkpoint-concretezjax-lax-dot-positional-argszjax-lib-modulezjax-nn-one-hot-float-inputzjax-numpy-arange-complexz jax-numpy-astype-complex-to-realzjax-numpy-clip-argszjax-scipy-special-sph-harmzsafer-randint-configzjax-pmap-no-rank-reductionzjax-make-mesh-default-explicitzpltpu-memory-space-any)dataclassesr   r   typesr   r
   r   strr   r'   r    r"   r*   dictr(   r.   r5   r8   r:   intr   r)   r   r   <module>rB      sd   "   </: /S /T //Z /s /t /    9; $s$445 :@S @T @/s /t />s >t >>3 >4 >- -s - - - 		$ % 	" # 	& ' 	  	% & 	# $ 	+ , 	  	% & 	   	% & 	) * 	! "r   