o
    ei                     @   s`   d dl Z d dlZd dlZd dlmZmZmZ d dlmZm	Z	 dededdfddZ
ed	e
 dS )
    N)_register_handler_Request	_Response)_ExperimentalConfigprofilereqrespreturnc                 C   s   t dd}t| d}td|d}t| W d    n1 s"w   Y  tjddd }||j	 |
t|j	 d |d	 W d    d S 1 sQw   Y  d S )
NT)profile_all_threadsduration)record_shapesexperimental_configtorch_debugz.json)prefixsuffixzapplication/json   )r   float	get_paramr   timesleeptempfileNamedTemporaryFileexport_chrome_tracenameset_contentpathlibPath
read_bytes
set_status)r   r   r   r   proff r!   k/var/www/addictedbytheproject.nl/epg/venv/lib/python3.10/site-packages/torch/distributed/debug/_handlers.py_torch_profile	   s   "r#   torch_profile)r   r   r   torch._C._distributed_c10dr   r   r   torch.profilerr   r   r#   r!   r!   r!   r"   <module>   s    