
    Χg	                        d Z ddlZddlmc mZ ddlmZ ddlm	Z	 ddl
mZmZ g dZd Z ej        ej        d	          Z ed
           e	j        ddddd          dej        dej        dej        dededefd                        Z ed           e	j        ddd          dej        dej        dej        defd                        Z ed           e	j        dd          ddej        dej        defd                        ZdS ) a  This file exports ONNX ops for opset 20.

Note [ONNX Operators that are added/updated in opset 20]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://github.com/onnx/onnx/blob/main/docs/Changelog.md#version-20-of-the-default-onnx-operator-set
New operators:
    AffineGrid
    ConstantOfShape
    DFT
    Gelu
    GridSample
    ImageDecoder
    IsInf
    IsNaN
    ReduceMax
    ReduceMin
    RegexFullMatch
    StringConcat
    StringSplit
    N)_C)symbolic_helper)	jit_utilsregistration)_grid_sampler_affine_grid_generatorgeluc                 &    | dk    rdn	| dk    rdn| S )Nbilinearlinearbicubiccubic )mode_ss    W/var/www/html/ai-engine/env/lib/python3.11/site-packages/torch/onnx/symbolic_opset20.pyconvert_grid_sample_moder   &   s'    j((99L9LggRX       )opsetzaten::grid_samplervibginputgrid	mode_enumpadding_mode_enumalign_cornersc                 (   d t           j                                        D             |         }t          |          }d t           j                                        D             |         }|                     d||t          |          ||          S )Nc                     i | ]\  }}||	S r   r   .0kr   s      r   
<dictcomp>z!_grid_sampler.<locals>.<dictcomp>9   s    IIItq!aIIIr   c                     i | ]\  }}||	S r   r   r!   s      r   r$   z!_grid_sampler.<locals>.<dictcomp><   s    KKKtq!aKKKr   
GridSample)align_corners_ir   padding_mode_s)FGRID_SAMPLE_INTERPOLATION_MODESitemsr   GRID_SAMPLE_PADDING_MODESopint)r   r   r   r   r   r   r   r(   s           r   r   r   /   s     JIq@FFHHIII)TF%f--FKKq'B'H'H'J'JKKKN 44M**%    r   zaten::affine_grid_generatorthetasizec                 N    |                      d||t          |                    S )N
AffineGrid)r'   )r-   r.   )r   r/   r0   r   s       r   r   r   I   s3     44M**	    r   z
aten::gelusnoneselfapproximatec                 2    |                      d||          S )NGelu)approximate_s)r-   )r   r5   r6   s      r   r	   r	   Y   s     44K4888r   )r4   )__doc__	functoolstorch.nn.functionalnn
functionalr)   torchr   
torch.onnxr   torch.onnx._internalr   r   __all__r   partialonnx_symbolic_onnx_symbolic
parse_argsGraphContextValuer.   boolr   r   strr	   r   r   r   <module>rK      s   ,                    & & & & & & 8 8 8 8 8 8 8 8 >
=
=   #"<#=RHHH $%%Cc3448 ( 	
     54 &%0 -..Cc**8 ( 	   +* /. C%%9 9I" 9"( 9 9 9 9 &% 9 9 9r   