a
    Ž¥»a
  ã                   @   s˜   d dl mZmZ d dl m  mZ d dlm  mZ d dl	Z	g d¢Z
ddd„Zddd„Zdd	„ Zed
d
dƒdd„ ƒZdd„ Ze
D ]Zeeƒeƒ e< q€dS )é    )Ú_block_list_in_opsetÚ
parse_argsN)
ÚscanÚexpandZ	expand_asZmeshgridZadaptive_max_pool1dZadaptive_max_pool2dZadaptive_max_pool3dZmax_pool1d_with_indicesZmax_pool2d_with_indicesZmax_pool3d_with_indicesc                 C   s*   |d u r|d urt  d¡ t | |||¡S )NzœMultidirectional broadcasting is not supported in opset 7. This might cause the onnx model to be incorrect, if inputs to max operators have different shapes)ÚwarningsÚwarnÚ
sym_opset9Úmax©ÚgÚselfZdim_or_yZkeepdim© r   úT/home/yuhw/wc/pochoir/venv/lib/python3.9/site-packages/torch/onnx/symbolic_opset7.pyr	      s    
r	   c                 C   s*   |d u r|d urt  d¡ t | |||¡S )NzœMultidirectional broadcasting is not supported in opset 7. This might cause the onnx model to be incorrect, if inputs to min operators have different shapes)r   r   r   Úminr
   r   r   r   r   &   s    
r   c                 G   s2   t |ƒdkrt | ||¡S t| ||g|¢R Ž S d S )Nr   )Úlenr   Útrue_divideÚ_div_rounding_mode)r   r   ÚotherÚargsr   r   r   Údiv/   s    r   ÚvÚsc                 C   s(   |dkrt | ||ƒS t | |||¡S d S )NÚfloor)Ú_floor_divider   r   )r   r   r   Zrounding_moder   r   r   r   6   s    r   c                 C   s:   t  |¡st  |¡r.t | ||¡}|  d|¡S tdƒ‚d S )NZFloorz7Integer floor division requires ONNX opset 9 or greater)Úsym_helpZ_is_fpr   r   ÚopÚRuntimeError)r   r   r   Úoutr   r   r   r   >   s    r   )NN)NN)Ztorch.onnx.symbolic_helperr   r   ZonnxZsymbolic_helperr   Ztorch.onnx.symbolic_opset9Zsymbolic_opset9r   r   Zblock_listed_operatorsr	   r   r   r   r   Zblock_listed_opÚvarsr   r   r   r   Ú<module>   s   

	
	

