
    Vh                        d Z ddlmZ ddlmZmZ ddlmZ ddlZ G d de      Z	i e	j                  de	j                  d	e	j                  d
e	j                  de	j                  de	j                  de	j                   de	j"                  de	j$                  de	j&                  de	j(                  de	j*                  de	j,                  de	j.                  de	j0                  de	j2                  dZde	dedej8                  fdZdej<                  dee	ee	   f   defdZ dejB                  dee	ee	   f   defdZ"y)a  
This file contains canonical definitions for our symbol naming conventions,
across torch.fx.experimental.symbolic_shapes and torch._inductor.  The
intention is:

1. To make it easily greppable where all the sites we use a prefix are
2. Make it possible to easily tell if we can introduce a new prefix without
   introducing a conflict

You can occasionally test if prefixes have been hardcoded by renaming prefixes
in this file and seeing what breaks.
    )Iterable)autoEnum)UnionNc                       e Zd Z e       Z e       Z e       Z e       Z e       Z e       Z	 e       Z
 e       Z e       Z e       Z e       Z e       Z e       Z e       Z e       Z e       Zy)SymTN)__name__
__module____qualname__r   SIZEFLOATUNBACKED_INTUNBACKED_FLOATTMPINDIRECTPRECOMPUTED_SIZEINDEXR0_INDEXR1_INDEXTEMPLATE_INDEXXBLOCKYBLOCKZBLOCKVIEWHALIDE     I/home/dcms/DCMS/lib/python3.12/site-packages/torch/utils/_sympy/symbol.pyr   r      s}    6DFE6LVN &CvH v FE vHvH
 VNVFVFVF6DVFr   r   suzfzuftmppsir0_r1_idxxyzindirectviewhprefixreturnc                 D    t        j                  t        |     | fi |S N)sympySymbol
prefix_str)r/   r(   kwargss      r   make_symbolr7   T   s%    <<:f-.se4???r   symc                     t        | t        j                        sJ | j                  j	                         }t        |t
              r|j                  t        |         S |j                  t        d |D                    S )Nc              3   .   K   | ]  }t         |     y wr2   )r5   ).0ps     r   	<genexpr>z!symbol_is_type.<locals>.<genexpr>a   s     (G1A(Gs   )	
isinstancer3   r4   namelowerr   
startswithr5   tuple)r8   r/   name_strs      r   symbol_is_typerD   [   sb    c5<<(((xx~~H&$"":f#566""5(G(G#GHHr   ec                 @    t        fd| j                  D              S )Nc              3   6   K   | ]  }t        |        y wr2   )rD   )r;   vr/   s     r   r=   z&free_symbol_is_type.<locals>.<genexpr>e   s     AQ~a(As   )anyfree_symbols)rE   r/   s    `r   free_symbol_is_typerK   d   s    A!..AAAr   )#__doc__collections.abcr   enumr   r   typingr   r3   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r5   intr4   r7   BasicboolrD   ExprrK   r   r   r   <module>rT      s   %   "4 "NIIss 	JJ 	 	HHe 	4 	JJ 	MM5 	MM5 	 	KK 	KK  	KK!" 	MM:#$ 	IIv%& 	KK'
.@ @3 @U\\ @I IU4$3G-H IT IB5:: BuT8D>5I/J Bt Br   