a
    –¥»a   ã                   @   sp   d dl mZ dZdd„ Zdd„ Zeeg d¢ƒZdd	„ e_ed
d�eƒ eeg d¢ƒZ	dd	„ e	_ed
d�e	ƒ dS )é   )ÚcompatibilityzÒIf you are attempting to modify the kwargs or args of a torch.fx.Node object,
instead create a new copy of it and assign the copy to the node:
    new_args = ... # copy and mutate args
    node.args = new_args
c                 O   s   t dt| ƒj› dt› �ƒ‚d S )Nú'z$' object does not support mutation. )ÚNotImplementedErrorÚtypeÚ__name__Ú_help_mutation)ÚselfÚargsÚkwargs© r   úX/home/yuhw/wc/pochoir/venv/lib/python3.9/site-packages/torch/fx/immutable_collections.pyÚ_no_mutation
   s    r   c                 C   s.   t d| j | fi ƒ}|D ]}t||tƒ q|S )NZ
immutable_)r   r   Úsetattrr   )ÚbaseZmutable_functionsÚ	containerÚattrr   r   r   Ú_create_immutable_container   s    r   )
Ú__delitem__Ú__iadd__Ú__imul__Ú__setitem__ÚappendÚclearÚextendÚinsertÚpopÚremovec                 C   s   t tt| ƒƒffS ©N)Úimmutable_listÚtupleÚiter©r   r   r   r   Ú<lambda>   ó    r"   T)Zis_backward_compatible)r   r   r   r   ÚpopitemÚupdatec                 C   s   t t|  ¡ ƒffS r   )Úimmutable_dictr    Úitemsr!   r   r   r   r"      r#   N)
Z_compatibilityr   r   r   r   Úlistr   Ú
__reduce__Údictr&   r   r   r   r   Ú<module>   s   ÿ

