
    Vh                     N    d Z ddlmZ ddlZddlmZ ddlmZ dedee   ddfd	Zy)
z
Tools to help with tensor property propagation.

This is not intended to be imported directly; please use the exposed
functionalities in `torch.jit`.
    )AnyN)
TensorType)Graphgraphexample_inputreturnc                    t        | j                               }t        |      dk(  ry|d   }t        |j	                         t
        j                  j                        r|j                         dk(  r|dd }t        |      t        |      k(  st        d      t        t        ||            D ]  \  }\  }}|t        |t
        j                        t        |j	                         t              k7  rt        d| d||      t        |t
        j                        sq|j                  t        j                  |              y)z`
    Applies properties for each tensor in the graph inputs
    using the example supplied.
    r   Nself   zHNumber of inputs in graph does not match number of inputs in the examplezInput z does not match type of example)listinputslen
isinstancetypetorch_C	ClassType	debugNameRuntimeError	enumeratezipTensorr   setTypecreate_from_tensor)r   r   graph_inputsin_0igraph_i	example_is          W/home/dcms/DCMS/lib/python3.12/site-packages/torch/jit/_passes/_property_propagation.pyapply_input_props_using_exampler!      s#   
 'L
<A ?D$))+uxx112t~~7G67Q#AB'|M 22V
 	
 $-S}-M#N FGYi.*LLNJ3
 
 :;Wi  i.OOJ99)DEF    )	__doc__typingr   r   r   torch._Cr   r   r!    r"   r    <module>r'      s:       F5 Fc Ft Fr"   