
    3KiI                         S SK r S SKJr  S SKJrJr  S SKJr  \" S5      r\" S5      r	\" S5      r
\" 5       rS\\\
\4   \	4   S	\\\
\4   \	4   4S
 jrg)    N)Callable)ConcatenateTypeVar)	ParamSpec_P_T_Cfreturnc           	         ^ ^ ST R                   -   m[        R                  " T 5      S[        S[        R
                  S[        R                  S[        4UU 4S jj5       nU$ )a  
Like `@functools.cache` but for methods.

`@functools.cache` (and similarly `@functools.lru_cache`) shouldn't be used
on methods because it caches `self`, keeping it alive
forever. `@cache_method` ignores `self` so won't keep `self` alive (assuming
no cycles with `self` in the parameters).

Footgun warning: This decorator completely ignores self's properties so only
use it when you know that self is frozen or won't change in a meaningful
way (such as the wrapped function being pure).
_cache_method_selfargskwargsr   c                    > U(       a  [        S5      e[        U TS 5      =n(       d  0 n[        U TU5        UR                  U[        5      nU[        La  U$ T" U /UQ70 UD6nXSU'   U$ )Nz.cache_method does not accept keyword arguments)AssertionErrorgetattrsetattrget_cache_sentinel)r   r   r   cachecached_valuevalue
cache_namer
   s         X/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/torch/utils/_functools.pywrapcache_method.<locals>.wrap    su     !QRR z4888ED*e,yy7.$(((d    )__name__	functoolswrapsr	   r   r   r   r   )r
   r   r   s   ` @r   cache_methodr"      sY     "AJJ.J__Q2 bgg  r   Kr   )r    collections.abcr   typingr   r   typing_extensionsr   r   r   r	   objectr   r"    r   r   <module>r(      sr     $ ' ' t_T]T] (!BF#R'(!k"b&!2%&!r   