
    ёis                        S SK Jr  S SKrS SKrS SKJrJrJr  S SKJ	r	  S SK
r
S SKJr  S SKJr  S SKJrJr  \	" S5      r\" S	5      r\(       a  S S
KJr  SS jr    SS jr\" \5      rg)    )annotationsN)TYPE_CHECKINGCallableTypeVar)	ParamSpec)
stride_ops)wrap_decorator)in_dynamic_modein_pir_mode_InputT_RetT)Valuec                &   U R                  5       R                  5       [        ;   a  gU R                  5       n[	        U5      S:X  a  gU HD  nUR                  5       [        ;   d  M  UR                  S5      R                  U 5      (       d  MD    g   g)NTr   F)get_defining_opnamer   all_used_opslenoperand_sourceis_same)valuer   ops      Z/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/paddle/utils/inplace_utils.pycheck_view_valuer   "   sz    ##%3%%'L
<A779
"r'8'8';'C'CE'J'J 	 
     c                   ^  SU 4S jjnU$ )Nc                   > [        5       (       Gd9  TR                  S S n[        R                  " STR                   SU S35        SSKJn  U" 5       (       a  [        R                  R                  SS5      n[        5       (       a3  US	:w  a,  [        U S
   5      (       a  [        STR                   S35      eOmU  Hg  n[        US5      (       d  M  UR                  (       d  M)  [        STR                   SUR                   SUR                   SUR                   S3	5      e   TR                   SU 3n[!        U5      " U 0 UD6$ T" U 0 UD6$ )NzIn static graph mode, z() is the same as z*() and does not perform inplace operation.   )in_to_static_modestride_in_no_check_dy2st_diff01r   z0Sorry about what's happened. In to_static mode, z's output variable is a viewed Tensor in dygraph. This will result in inconsistent calculation behavior between dynamic and static graphs. You must find the location of the strided API be called, and call paddle.assign() before inplace input.is_view_varz's output variable z is a viewed Tensor in dygraph. This will result in inconsistent calculation behavior between dynamic and static graphs. You must find the location of the strided API be called, and call z = paddle.assign(z)..)r
   __name__warningswarnbase.dygraph.baser   osenvirongetr   r   
ValueErrorhasattrr#   r   
__module__eval)argskwargsorigin_api_namer   r    argorigin_funcfuncs          r   __impl__0_inplace_apis_in_dygraph_only_.<locals>.__impl__:   s     "mmCR0OMM(7I/IZ  [E  F > ""02

3S1- ==5<,T!W55(OPTP]P]  _R  S   $"3663???","STXTaTaSbbvwzww  wA  A|  }@  }E  }E  |F  FW  X[  X`  X`  Wa  ac  !d#   $ "__-Q.?@K$d5f55T$V$$r   )r0   z_InputT.argsr1   z_InputT.kwargsreturnr    )r5   r6   s   ` r   _inplace_apis_in_dygraph_only_r:   7   s    %> Or   )r   r   r8   bool)r5   Callable[_InputT, _RetT]r8   r<   )
__future__r   r)   r&   typingr   r   r   typing_extensionsr   paddlepaddle.base.frameworkr   paddle.base.wrapped_decoratorr	   paddle.frameworkr
   r   r   r   
paddle.pirr   r   r:   inplace_apis_in_dygraph_onlyr9   r   r   <module>rF      sh    # 	  3 3 '  , 8 9
I
 *"
"""J  ..LM r   