a
    h+                     @   s   d dl mZmZ d dlmZmZ d dlmZmZ d dl	m
Z
 ddlmZ eeddeee
gef ed	d
dZeeddeeegef ed	ddZddgZdS )    )AnyCallable)_fx_map_aggregate_fx_map_arg)immutable_dictimmutable_list)Node   )substitute_in_graphT)Zcan_constant_fold_through)afnreturnc                    s   t |  fddS )Nc                    s   t | tr | S | S N)
isinstancer   )xr    H/var/www/auris/lib/python3.9/site-packages/torch/_dynamo/polyfills/fx.py<lambda>       zmap_arg.<locals>.<lambda>map_aggregate)r   r   r   r   r   map_arg
   s    r   c                    s   t | tr< fdd| D }t| dr2t| | nt|}nt | tr^t fdd| D }n^t | trt fdd|  D }n8t | t	rt	t
| j t
| j t
| j }n | }|S )Nc                 3   s   | ]}t | V  qd S r   r   .0elemr   r   r   	<genexpr>   r   z map_aggregate.<locals>.<genexpr>_fieldsc                    s   g | ]}t | qS r   r   r   r   r   r   
<listcomp>   r   z!map_aggregate.<locals>.<listcomp>c                    s   g | ]\}}|t | fqS r   r   )r   kvr   r   r   r      r   )r   tuplehasattrtypelistr   dictr   itemsslicer   startstopstep)r   r   itresultr   r   r   r      s    
 





r   N)typingr   r   Ztorch._Cr   r   Ztorch.fx.immutable_collectionsr   r   Ztorch.fx.noder   Z
decoratorsr
   r   r   __all__r   r   r   r   <module>   s   

