
    ¯wg	                     P   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y)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S | dk(  rdS | S )Nbilinearlinearbicubiccubic )mode_ss    `/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/torch/onnx/symbolic_opset20.pyconvert_grid_sample_moder   &   s(    j(9?99LgRX       )opsetzaten::grid_samplervibginputgrid	mode_enumpadding_mode_enumalign_cornersc                 D   t         j                  j                         D ci c]  \  }}||
 c}}|   }t        |      }t         j                  j                         D ci c]  \  }}||
 c}}|   }	| j                  d||t        |      ||	      S c c}}w c c}}w )N
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   kr   r   r"   s
             r   r   r   /   s      !@@FFHItq!adI)TF%f-F'('B'B'H'H'JKtq!adKN 44M*%    J Ls   B"Bzaten::affine_grid_generatorthetasizec                 >    | j                  d||t        |            S )N
AffineGrid)r!   )r'   r(   )r   r*   r+   r   s       r   r   r   I   s+     44M*	   r   z
aten::gelusselfapproximatec                 *    | j                  d||      S )NGelu)approximate_s)r'   )r   r/   r0   s      r   r	   r	   Y   s     44K488r   )none)__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>rF      sw  ,     & 8 > #""<#=#=RH $%Cc3488 (( 	
   5 &0 -.Cc*88 (( 	 + / C%9I"" 9"(( 9 9 & 9r   