U
    wh*                     @   sF   d dl mZ d dlmZmZ dd ZedddZedkrBed	d
S )    )List)_compile_graph_to_code_table_generate_upgraders_graphc                    s>    fdd i }| D ]$}|d }|d } |}|||< q|S )Nc                    s    t | ts| S  fdd| D S )Nc                    s   g | ]} |qS  r   ).0ilistifyr   M/var/www/html/venv/lib/python3.8/site-packages/torch/jit/generate_bytecode.py
<listcomp>   s     z4format_bytecode.<locals>.listify.<locals>.<listcomp>)
isinstancetuple)contentr   r   r
   r	   	   s    
z format_bytecode.<locals>.listifyr      r   )tableZformatted_tableentry
identifierr   r   r   r
   format_bytecode   s    
r   )returnc                  C   s@   g } t  }| D ](\}}t||}|t|i}| | q| S )N)r   itemsr   r   append)Zyaml_contentZupgraders_graph_mapZupgrader_nameZupgrader_graphZbytecode_tabler   r   r   r
   generate_upgraders_bytecode   s    
r   __main__z)This file is not meant to be run directlyN)	typingr   Ztorch._Cr   r   r   r   __name__RuntimeErrorr   r   r   r
   <module>   s
   
