U
    yhՅ                     @   s  d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm	Z	m
Z
mZmZmZmZmZmZmZmZ d dlmZmZ erd dlZd dlmZ d dlZd dlm  mZ d dlmZm Z  d dl!m"Z" d dl#m$Z$ d d	l%m&Z& d d
l'm(Z( d dl)m*Z* d dl+m,Z, ddl-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9 dddgZ:e
ej;j<gee( f Z=ej>G dd dZ?ej>G dd dZ@dd ZAeeB ejCeeB ejCeDdddZEd+eeFeFf eFeFeDdddZGej;j<ddddZHG d d dZId!d" ZJd,ej;j<d$eDd%d&d'd(ZKd)d* ZLdS )-    N)
namedtuple)
AnyCallableDictIteratorListOptionalTupleTypeTYPE_CHECKINGUnion)immutable_dictimmutable_list)ValueRanges)is_equivalentreorder_kwargs)compatibility)#first_call_function_nn_module_stackmaybe_disable_fake_tensor_mode)
PassResult)PassManager)insert_deferred_runtime_asserts   )_sig_to_specsArgumentSpecConstantArgumentCustomObjArgumentExportGraphSignature	InputKind	InputSpec
OutputKind
OutputSpecSymIntArgumentTensorArgumentTokenArgumentExportedProgramModuleCallEntryModuleCallSignaturec                   @   s:   e Zd ZU ee ed< ee ed< ejed< ejed< dS )r(   inputsoutputsin_specout_specN)__name__
__module____qualname__r   r   __annotations__pytreeZTreeSpec r2   r2   O/var/www/html/venv/lib/python3.8/site-packages/torch/export/exported_program.pyr(   G   s   

c                   @   s&   e Zd ZU eed< dZee ed< dS )r'   fqnN	signature)r-   r.   r/   strr0   r5   r   r(   r2   r2   r2   r3   r'   O   s   
c                    s   t   fdd}|S )Nc               
      s(   t    | |W  5 Q R  S Q R X d S Nr   )argskwargsfnr2   r3   wrapperV   s    z/_disable_prexisiting_fake_mode.<locals>.wrapper)	functoolswraps)r;   r<   r2   r:   r3   _disable_prexisiting_fake_modeU   s    r?   )
spec1_typespec1_context
spec2_typespec2_contextreturnc                 C   sx   | dks|dkr | |ko||kS t | ttfrDt |ttfrD||kS t | ttfrht |ttfrh||kS | |kov||kS )zeTreat containers and their immutable variants as the same type. Otherwise
    compare as normal.
    N)
issubclassdictr   listr   )r@   rA   rB   rC   r2   r2   r3   _fx_collection_equivalence_fn^   s    	  rH   F)name_map	orig_namenameis_placeholderc                 C   s   ||   krrtd|}|r<|s<|dt|d }}nd}| d|d   }|   krh|d7 }q@|| |< n|| |< | | S )a  
    Renames nodes to avoid name collisions, with suffixing.
    name_map: map from original name to new name
    orig_name: mapping key
    name: candidate name (potentially suffixed, e.g. mul_2)
    is_placeholder: if the node is a placeholder, avoid detecting suffix
    z
(.*)_(\d+)r      r   _)valuesrematchgroupint)rI   rJ   rK   rL   rQ   nZdup_namer2   r2   r3   _rename_without_collisionsw   s    

rU   )gmrD   c                 C   sf  g }| j jD ]}|jdkrt|jtjjr|jjdkrr|j	\}}}}|
t| |j|f |
t| |j|f q|jjdkr|j	d |j	dd  }}|
t| |j|f q|jjdkr|j	\}	}
}|
t| |	j|
| f q|D ]x\}}i }t|j jD ]N\}}|t|k r:|| j||j< || j |_|_nt||j|j|_q t| |  qdS )a0  
    Propagate placeholder names from the top-level graph into HigherOrderOp subgraphs,
    and handle collisions with non-placeholders by count suffixing.
    Different HOO subgraph types have different input schemas, so we first enumerate them
    and gather the top-level named placeholder nodes.
    Zcall_functionZcondZwrap_with_set_grad_enabledr   rM   NZmap_impl)graphnodesop
isinstancetargettorch_opsZHigherOrderOperator_name_argsappendgetattr	enumeratelenrK   rU   _name_hoo_subgraph_placeholdersZ	recompile)rV   Zsubgraph_ph_tuplesnoderN   Z
true_graphZfalse_graphZ	cond_argsZsubgraphZphsZ
body_grapharrayr8   Zhoo_phsrI   ir2   r2   r3   rd      s6     rd   c                   @   s  e Zd ZdZdFeejjee	e
f f ejjeee	eejejjf f dee eeee
df ee	e
f f  eee
  eee	ejf  eee	eejejjf f  d
ddZeedd	d
d Zeedd	dd Zeedd	dd Zeedd	dd Zedd	eejj dddZedd	eee	ejjf  dddZ edd	eej dddZ!edd	eee	ejf  dddZ"eedd	dd Z#eedd	dd Z$eedd	dd  Z%eedd	d!d" Z&eedd	e
dd#d$Z'eedd	e	dd%d&Z(eedd	d'd( Z)eedd	d)d* Z*d+d, Z+e
e
e
d-d.d/Z,e
e
e
d-d0d1Z-d2d3 Z.e	dd4d5Z/ejjdd6d7Z0d8d9 Z1e2dGeeej3j4e5f  d d:d;d<Z6e7d d=d>d?Z8d@dA Z9dBdC Z:dHd ddDdEZ;dS )Ir&   a  
    Package of a program from :func:`export`. It contains
    an :class:`torch.fx.Graph` that represents Tensor computation, a state_dict containing
    tensor values of all lifted parameters and buffers, and various metadata.

    You can call an ExportedProgram like the original callable traced by
    :func:`export` with the same calling convention.

    To perform transformations on the graph, use ``.module`` property to access
    an :class:`torch.fx.GraphModule`. You can then use
    `FX transformation <https://pytorch.org/docs/stable/fx.html#writing-transformations>`_
    to rewrite the graph. Afterwards, you can simply use :func:`export`
    again to construct a correct ExportedProgram.
    NDict[sympy.Symbol, Any].)
rootrW   graph_signature
state_dictrange_constraintsmodule_call_graphexample_inputsverifiertensor_constants	constantsc                 C   s   t jj |_t||| _t|t jjr8| jj	
|j	 || _|| _|| _|d k	sVt|| _|| _|	pl|
pli | _| jd k	s~tddlm} |d kr|}t||st|| _|  |  d S )Nr   )Verifier)r\   fxrW   ZCodeGenZ_codegen_create_graph_module_for_export_graph_modulerZ   GraphModulemetaupdate_graph_signature_state_dict_range_constraintsAssertionError_module_call_graph_example_inputs
_constantsZtorch._export.verifierrr   rE   	_verifierro   check)selfri   rW   rj   rk   rl   rm   rn   ro   rp   rq   rr   r2   r2   r3   __init__   s$    zExportedProgram.__init__F)Zis_backward_compatiblec                 C   s   | j S r7   )ru   r   r2   r2   r3   graph_module   s    zExportedProgram.graph_modulec                 C   s   | j jS r7   )r   rW   r   r2   r2   r3   rW      s    zExportedProgram.graphc                 C   s   | j S r7   )ry   r   r2   r2   r3   rj     s    zExportedProgram.graph_signaturec                 C   s   | j S r7   )rz   r   r2   r2   r3   rk     s    zExportedProgram.state_dict)rD   c                 c   s   |   D ]\}}|V  qdS )zH
        Returns an iterator over original module's parameters.
        N)named_parameters)r   rN   paramr2   r2   r3   
parameters  s    zExportedProgram.parametersc                 c   s"   | j jD ]}|| j| fV  qdS )z
        Returns an iterator over original module parameters, yielding
        both the name of the parameter as well as the parameter itself.
        N)rj   r   rk   )r   
param_namer2   r2   r3   r     s    z ExportedProgram.named_parametersc                 c   s   |   D ]\}}|V  qdS )zC
        Returns an iterator over original module buffers.
        N)named_buffers)r   rN   bufr2   r2   r3   buffers  s    zExportedProgram.buffersc                 c   sH   t | jj}| jjD ].}||kr2|| j| fV  q|| j| fV  qdS )z
        Returns an iterator over original module buffers, yielding
        both the name of the buffer as well as the buffer itself.
        N)setrj   non_persistent_buffersr   rq   rk   )r   r   Zbuffer_namer2   r2   r3   r   %  s
    zExportedProgram.named_buffersc                 C   s   | j S r7   )r{   r   r2   r2   r3   rl   2  s    z!ExportedProgram.range_constraintsc                 C   s   | j S r7   )r}   r   r2   r2   r3   rm   7  s    z!ExportedProgram.module_call_graphc                 C   s   | j S r7   )r~   r   r2   r2   r3   rn   <  s    zExportedProgram.example_inputsc                 C   s\   t dddg}t| jdkr(|d d dS | jd jdks<t|| jd jj| jd jjdS )NCallSpecr+   r,   r   )r+   r,    )r   rc   rm   r4   r|   r5   r+   r,   )r   r   r2   r2   r3   	call_specA  s    zExportedProgram.call_specc                 C   s   | j S r7   )r   r   r2   r2   r3   ro   N  s    zExportedProgram.verifierc                 C   s   | j jS r7   )r   dialectr   r2   r2   r3   r   S  s    zExportedProgram.dialectc                 C   s   | j S r7   r   r   r2   r2   r3   rp   X  s    z ExportedProgram.tensor_constantsc                 C   s   | j S r7   r   r   r2   r2   r3   rq   ]  s    zExportedProgram.constantsc                 C   sP   | j j}|dk	rt||}t||f\}}| | tdd |D }||fS )a  Flatten args, kwargs using pytree, then, check specs.

        Args:
            args: List[Any] original args passed to __call__
            kwargs: Dict[str, Any] original kwargs passed to __call

        Returns:
            A tuple of (flat_args, received_spec)
            flat_args is flattend args / kwargs
            received_spec is the pytree spec produced while flattening the
            tuple (args, kwargs)
        Nc                 s   s   | ]}|d  V  qdS )r   Nr2   ).0xr2   r2   r3   	<genexpr>v  s     z<ExportedProgram._get_flat_args_with_check.<locals>.<genexpr>)r   r+   r   r1   Ztree_flatten_with_path_check_input_constraintstuple)r   r8   r9   r+   flat_args_with_pathreceived_spec	flat_argsr2   r2   r3   _get_flat_args_with_checkb  s    

z)ExportedProgram._get_flat_args_with_check)r8   r9   rD   c                 C   s   | j j}| ||\}}|dk	r@t||ts@td| d| g }| jjD ]|}|jt	j
kr`qLqL|jt	jt	jfkr|jdkr|| j|j  q|| j|j  qL|jt	jt	jfkrL|| j|j  qLt|}|| S )a,  Transform args, kwargs of __call__ to args for graph_module.

        self.graph_module takes stuff from state dict as inputs.
        The invariant is for ep: ExportedProgram is
        ep(args, kwargs) ==
          ep.postprocess(ep.graph_module(ep.graph_module_flat_inputs(args, kwargs)))
        Nz>Trying to flatten user inputs with exported input tree spec: 
z-
but actually got inputs with tree spec of: 
F)r   r+   r   r   rH   
ValueErrorrj   input_specskindr   
USER_INPUTZ	PARAMETERZBUFFER
persistentr`   rq   r[   rk   ZCONSTANT_TENSORZ
CUSTOM_OBJr   )r   r8   r9   r+   r   r   Zadditional_inputsZinput_r2   r2   r3   _graph_module_flat_inputsy  s8    	
  
z)ExportedProgram._graph_module_flat_inputsc                 O   s   t dd S )Nz\Unable to call ExportedProgram directly. You should use `exported_program.module()` instead.)RuntimeError)r   r8   r9   r2   r2   r3   __call__  s    zExportedProgram.__call__c                    s  ddl m  m} | ||\}}| jjdk	r| jj}| jj}t	|t	| }	|d|	 }
| jj
}|dk	rtt| }|d| }||	d }zVzt|| jj}W n< tk
r   t|\}}|d| jj d	| Y nX W 5 dd | jjD }t|
D ]\}}| jj|   jtjkrF jdk	s8t|| j j< nX jtjkr jdk	sdtt fddt|D }|| | ntd j qX |S )
zProcess potential mutations to the input.

        Because self.graph_module is functional, so mutations has to be written
        back after execution of graph_module.
        r   Nc                 S   s   g | ]}|j tjkr|qS r2   r   r   r   )r   specr2   r2   r3   
<listcomp>  s   zEExportedProgram._postprocess_graph_module_outputs.<locals>.<listcomp>c                 3   s$   | ]\}}|j j jkr|V  qd S r7   )argrK   r[   r   rg   r   Zoutput_specr2   r3   r     s   zDExportedProgram._postprocess_graph_module_outputs.<locals>.<genexpr>zUnexpected kind: z@Trying to flatten user outputs with exported output tree spec: 
z.
but actually got outputs with tree spec of: 
)Ztorch._export.errorZ_exporterrorr   r   r,   rj   Zbuffers_to_mutateZuser_inputs_to_mutaterc   assertion_dep_tokennextiterkeysr   rb   output_specsr   r!   ZBUFFER_MUTATIONr[   r|   rk   ZUSER_INPUT_MUTATIONZcopy_r1   Ztree_unflatten	ExceptionZtree_flattenZInternalError)r   res	orig_argsZorig_kwargsr   r   rN   Zbuffer_mutationZuser_input_mutationZnum_mutatedZmutated_valuesr   Zassertion_dep_token_indexZuser_inputsrg   valueindexr   r2   r   r3   !_postprocess_graph_module_outputs  sF    z1ExportedProgram._postprocess_graph_module_outputsc                 C   s6   | j jdddd}d| d| j d| j d}|S )NF)Zprint_output
z
    zExportedProgram:
    z
Graph signature: z
Range constraints: )r   Zprint_readablereplacerj   rl   )r   r   stringr2   r2   r3   __str__  s     zExportedProgram.__str__c                 C   sT   ddl m} || }d	tddd}d
tddd}t|||_t|||_|S )z_
        Returns a self contained GraphModule with all the parameters/buffers inlined.
        r   )&_unlift_exported_program_lifted_statesT)modec                 S   s   t dd S )Nz%Calling train() is not supported yet.NotImplementedErrorr   r   r2   r2   r3   _train  s    z&ExportedProgram.module.<locals>._trainc                 S   s   t dd S )Nz$Calling eval() is not supported yet.r   r   r2   r2   r3   _eval  s    z%ExportedProgram.module.<locals>._eval)T)T)Z_unliftr   booltypes
MethodTypetraineval)r   r   moduler   r   r2   r2   r3   r     s    zExportedProgram.modulec                 C   s$   t dd t| jjD t| jjS )Nc                 s   s"   | ]\}}|j tjkr|V  qd S r7   r   )r   rg   sr2   r2   r3   r     s   z=ExportedProgram._num_lifted_params_buffers.<locals>.<genexpr>)r   rb   ry   r   rc   r   r2   r2   r3   _num_lifted_params_buffers  s    

z*ExportedProgram._num_lifted_params_buffers)decomp_tablerD   c           "         s\  ddl m} ddlm}m} ddlm} ddlm} dd }|dkrJ| }|| j	}d	d
 |D }	dd
 | j	
 D }
|
D ]}t| j	| qzddlm} |  || j	|	|dd\}}W 5 Q R X dd ||t|jjd jd  tt|kstt|D ]\}}|j |_|_qdd D }|jjD ](}|jdkrHq4t||j|j|_q4t| fddt| jjD fdd
t| jjD } fdd
t| jjD }tt|kstt||d}t|D ]j\}}t|j d t!j"s|j d |j d< |j|j#ks.|j|j$kr|j % D ]\}}||j |< q8q|j &| j	j  t'|| j(dd}|||| }|% D ]$\}}|| j)kst|| j)|< q|| ddl*m+} ddl,m-}m.} |j/s,d}t0|} | dk	r,||t1j2||d" t3|| dt4|j d d! W 5 Q R X t5||j|| j6|t78| j9| j:| j;| j)d"	}!|!S )#aU  
        Run a set of decompositions on the exported program and returns a new
        exported program. By default we will run the Core ATen decompositions to
        get operators in the
        `Core ATen Operator Set <https://pytorch.org/docs/stable/torch.compiler_ir.html>`_.

        For now, we do not decompose joint graphs.
        r   )core_aten_decompositions)ConstantAttrMaplift_constants_pass)_replace_sym_size_ops_pass)aot_export_modulec                 S   s.   g }| j jD ]}|jdkr q*|| q|S )Nplaceholder)rW   rX   rY   r`   )rV   placeholdersre   r2   r2   r3   _get_placeholders"  s    
z=ExportedProgram.run_decompositions.<locals>._get_placeholdersNc                 S   s   g | ]}|j d  qS )val)rw   r   re   r2   r2   r3   r   .  s     z6ExportedProgram.run_decompositions.<locals>.<listcomp>c                 S   s   g | ]\}}|qS r2   r2   )r   rK   rN   r2   r2   r3   r   0  s     _ignore_backend_decompsF)ZdecompositionsZtrace_jointc                 S   sP   t | tr| S t | tr$t|jdS t | tr:t|jdS tdt|  d S )NrK   zType of old_arg not supported: )rZ   r   r$   rK   r#   r   type)Zold_argnew_phr2   r2   r3   
update_arg@  s    


z6ExportedProgram.run_decompositions.<locals>.update_argc                 S   s   i | ]}|j |j qS r2   r   )r   phr2   r2   r3   
<dictcomp>R  s      z6ExportedProgram.run_decompositions.<locals>.<dictcomp>r   c                    s,   i | ]$\}}t |jts|jj | jqS r2   )rZ   r   r   rK   r   )new_placeholdersr2   r3   r   ]  s    c                    s0   g | ](\}}t |j|j | |j|jqS r2   )r    r   r   r[   r   r   )r   r   r2   r3   r   c  s   c              	      s6   g | ].\}}t |j|j | |j|jqS r2   )r"   r   r   getr[   r   )new_outputsold_new_placeholder_mapr   r2   r3   r   l  s   r   r   r   _is_executorch)config)_node_metadata_hook_set_node_metadata_hookzUFile "torch/fx/passes/runtime_assert.py", line 24, in insert_deferred_runtime_asserts)stack_tracezexported program: T)Zexport	ri   rW   rj   rk   rl   rm   rn   ro   rq   )<Ztorch._decompr   Z(torch._export.passes.lift_constants_passr   r   Z.torch._export.passes.replace_sym_size_ops_passr   Ztorch._functorch.aot_autogradr   r   r   delattrtorch.export._tracer   rG   rW   rX   r8   rc   r|   ziprK   r[   rY   rU   rd   rb   rj   r   r   r   rZ   rw   r\   TensorZinputs_to_parametersZinputs_to_buffersitemsrx   _get_updated_range_constraintsrl   rq   Ztorch._dynamor   Z(torch._export.passes._node_metadata_hookr   r   Zdo_not_emit_runtime_asserts_get_shape_envr=   partialr   r   r&   rk   copydeepcopyrm   rn   ro   )"r   r   r   r   r   r   r   r   Zold_placeholdersZ	fake_argsZbuffers_to_removerK   r   rV   rj   Zold_phr   rI   re   r   r   Znew_graph_signatureold_nodenew_nodekvZnew_range_constraintsrq   Z_dynamo_configr   r   r   	shape_envZexported_programr2   )r   r   r   r   r3   run_decompositions  s    
		


	
	 


 
z"ExportedProgram.run_decompositions)passesrD   c                 G   s   t t|}ddlm} |  || j}W 5 Q R X |d k	rB|jn| j}|d k	sTt|| jkrh|jsh| S ttj	j
tddd}t||j|| j|| jt|| jddt| j| j| j| jd	}|jj| jj |jj|jj |S )	Nr   r   )old_signaturenew_gmrD   c                 S   s.  g }t |jjD ]v\}}|jdkr& q|t| jk s<td| j| }t|jt	t
fr\|jnt|j|j}|t|j||j|j qt|jjd }|jdkstg }t |jd D ]d\}}|t| jk std| j| }	t|	jt	t
fr|	jnt|	j|j}|t|	j||	j qt||d}
|
S )zO
            Update the graph signature's user_input/user_outputs.
            r   z-Number of inputs changed after transformationr   outputr   z.Number of outputs changed after transformationr   )rb   rW   rX   rY   rc   r   r|   rZ   r   r   r   r   rK   r`   r    r   r[   r   rG   r8   r   r"   r   )r   r   Znew_input_specsrg   re   Zold_input_specr   Zoutput_nodeZnew_output_specsZold_output_specZnew_signaturer2   r2   r3   _get_updated_graph_signature  sd    

 	
  zKExportedProgram._transform_do_not_use.<locals>._get_updated_graph_signatureFr   r   )r   rG   r   r   r   r|   modifiedr   r\   rs   rv   r&   rW   rj   rk   r   rl   r   r   r}   rn   ro   rq   rw   rx   )r   r   pmr   r   Ztransformed_gmr   Ztransformed_epr2   r2   r3   _transform_do_not_use  sB    9 
z%ExportedProgram._transform_do_not_usec                 C   sH   ddl m} dd | jjD }dd t|| jjD }|||| j d S )Nr   )"_check_input_constraints_for_graphc                 S   s   g | ]}|j d kr|qS )r   )rY   )r   pr2   r2   r3   r     s     
 z<ExportedProgram._check_input_constraints.<locals>.<listcomp>c                 S   s    g | ]\}}|j tjkr|qS r2   r   )r   r  r   r2   r2   r3   r      s   )Ztorch._export.utilsr  rW   rX   r   rj   r   rl   )r   r   r  r   Zinput_placeholdersr2   r2   r3   r     s      z(ExportedProgram._check_input_constraintsc                 C   s   |   |  d S r7   )ro   r   r   r2   r2   r3   	_validate)  s    zExportedProgram._validatec                 C   s8   t ||j||p| jt| jt| j| j| j| j	d	S )N)	ri   rW   rj   rk   rl   rm   rn   ro   rp   )
r&   rW   rk   r   r   rl   r}   rn   ro   rp   )r   r   rj   rk   r2   r2   r3   _update-  s    

zExportedProgram._update)NNNN)N)N)<r-   r.   r/   __doc__r   r\   nnModuler   r6   r   rs   Graphr   r   	Parameterr   r'   r   r	   r
   Z_CZScriptObjectr   propertyr   r   rW   rj   rk   r   r   r   r   r   rl   rm   rn   r   ro   r   rp   rq   r   r   r   r   r   r   r   r?   r]   ZOperatorBaser   r   PassTyper  r   r  r  r2   r2   r2   r3   r&      s       
* .7
  3] c                 C   sZ   dd | j jD }ddlm} ||}|d k	r4|jS |D ]}t|tjr8|jj  S q8d S )Nc                 S   s(   g | ] }|j d ddk	r|j d  qS )r   N)rw   r   r   r2   r2   r3   r   >  s   z"_get_shape_env.<locals>.<listcomp>r   )detect_fake_mode)	rW   rX   Ztorch._guardsr  r   rZ   r\   ZSymIntre   )rV   valsr  Z	fake_moder   r2   r2   r3   r   =  s    r   Tz!Optional[Dict[sympy.Symbol, Any]]rh   )rV   old_range_constraintsr   rD   c                    s   |rf|d kst t|   d kr$i S  fdd j D } j D ]\}}| jkrF|||< qF|S |d k	srt t|   d kri S t|} fdd| D } j D ]"\}}| jkr||kr|||< q|S )Nc                    s    i | ]\}}| j kr||qS r2   replacementsr   r   r   r   r2   r3   r   X  s   
 z2_get_updated_range_constraints.<locals>.<dictcomp>c                    s    i | ]\}}| j kr||qS r2   r  r  r  r2   r3   r   l  s    
  )r|   r   Zvar_to_ranger   r  r   )rV   r  r   rl   r   r   r2   r  r3   r   M  s0    





r   c                 C   sP   zt j| |}W n8 tk
rJ   td t j| t j }||_Y nX |S )NzUnable to execute the generated python source code from the graph. The graph module will no longer be directly callable, but you can still run the ExportedProgram, and if needed, you can run the graph module eagerly using torch.fx.Interpreter.)r\   rs   rv   SyntaxErrorwarningswarnr	  Z_graph)ri   rW   rV   r2   r2   r3   rt   x  s    rt   )F)NT)Mr   dataclassesr=   rP   r   r  collectionsr   typingr   r   r   r   r   r   r	   r
   r   r   Ztorch.fx.immutable_collectionsr   r   ZsympyZtorch.utils._sympy.value_rangesr   r\   Ztorch.utils._pytreeutilsZ_pytreer1   Ztorch.export._tree_utilsr   r   Ztorch.fx._compatibilityr   Ztorch.fx._utilsr   Z"torch.fx.experimental.proxy_tensorr   Ztorch.fx.passes.infra.pass_baser   Z"torch.fx.passes.infra.pass_managerr   Ztorch.fx.passes.runtime_assertr   rj   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   __all__rs   rv   r  	dataclassr(   r'   r?   r   Contextr   rH   r6   rU   rd   r&   r   r   rt   r2   r2   r2   r3   <module>   sz   08
 
*       +