U
    Mh}                     @   s   d dl Z G dd dZdS )    Nc                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )StaticModulec                 C   s0   t |drtj|j| _ntj|j| _d S )N_c)hasattrtorchZ_CZ_jit_to_static_moduler   static_modulegraph)selfZscripted r	   W/var/www/html/venv/lib/python3.8/site-packages/torch/testing/_internal/static_module.py__init__   s    
zStaticModule.__init__c                 O   s   | j ||S N)r   r   argskwargsr	   r	   r
   __call__   s    zStaticModule.__call__c                 C   s   | j |||| d S r   )r   	benchmarkr   r   r   Zwarmup_runsZ	main_runsr	   r	   r
   r      s    zStaticModule.benchmarkc                 C   s   | j ||S r   )r   runAsyncr   r	   r	   r
   r      s    zStaticModule.runAsyncc                 C   s   | j ||||S r   )r   benchmark_individual_opsr   r	   r	   r
   r      s       z%StaticModule.benchmark_individual_opsN)__name__
__module____qualname__r   r   r   r   r   r	   r	   r	   r
   r      s
   r   )r   r   r	   r	   r	   r
   <module>   s   