
    Vh+                     Z    d dl mZ d dlmZ dgZdej
                  dej
                  fdZy)    )SequenceN	set_tracegmreturnc                     dt         t           dt        t           fd| j                  j	                  fd      5  | j                          ddd       | S # 1 sw Y   | S xY w)a  
    Sets a breakpoint in `gm`'s generated python code. It drops into pdb when
    `gm` gets run.

    Args:
        gm: graph module to insert breakpoint. It is then recompiled for it to
            take effect.

    Returns:
        the `gm` with breakpoint inserted.
    bodyr   c                     dg| S )Nzimport pdb; pdb.set_trace()
 )r   s    K/home/dcms/DCMS/lib/python3.12/site-packages/torch/fx/experimental/debug.py
insert_pdbzset_trace.<locals>.insert_pdb   s    /7$77    c                       fdS )Nc                 0     r |             S |       S )Nr
   )r   cur_transformr   s    r   <lambda>z-set_trace.<locals>.<lambda>.<locals>.<lambda>   s    *M]4%8T tT r   r
   )r   r   s   `r   r   zset_trace.<locals>.<lambda>   s    U r   )make_transformerN)r   strlistgraphon_generate_code	recompile)r   r   s    @r   r   r   	   se    8# 849 8 
	"	"
 
# 
  	 I Is   AA$)collections.abcr   torch.fxfx__all__GraphModuler   r
   r   r   <module>r      s/    $  -".. R^^ r   