
    sg8                     x   d Z ddlZddlZddlmZ ddlmZmZ ddlm	Z	m
Z
  ej                  e
j                  d      Z ed      d	e	j                  fd
       Z ed      ej                   d	e	j                  fd              Z ed      dd	e	j                  fd       Z ed      d	e	j                  fd       Zy)am  This file exports ONNX ops for opset 15.

Note [ONNX operators that are added/updated in opset 15]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://github.com/onnx/onnx/blob/master/docs/Changelog.md#version-15-of-the-default-onnx-operator-set
New operators:
    Bernoulli
    CastLike
    Optional
    OptionalGetElement
    OptionalHasElement

Updated operators:
    BatchNormalization https://github.com/onnx/onnx/pull/3545
                        Backwards compatible
                        TODO: test coverage for mixed types inputs.
    Pow                https://github.com/onnx/onnx/pull/3412
                        Backwards compatible
                        TODO: bfloat16 support.
    Shape              https://github.com/onnx/onnx/pull/3580
                        Backwards compatible
                        TODO: optional start/end attribute.
    N)_C)symbolic_helpersymbolic_opset9)	jit_utilsregistration   )opsetzaten::__is_gc                 @   t        j                  |      rst        |j                         t        j
                        r$| j                  d|      }| j                  d|      S | j                  dt        j                  dg            S t        j                  | ||      S )NOptionalHasElementNotConstantr   )value_t)r   _is_none
isinstancetyper   OptionalTypeoptorch
BoolTensoropset9eq)r
   selfothernones       N/var/www/html/venv/lib/python3.12/site-packages/torch/onnx/symbolic_opset15.py	aten__is_r   (   sy    &diik2??344,d3D44t$$44
E,<,<aS,A4BB99Qe$$    zaten::__isnot_c                     t        | ||      S )N)r   )r
   r   r   s      r   aten__isnot_r    3   s     Qe$$r   zaten::bernoullic                 >   |,t        j                  |      st        j                  dd|       |,t        j                  |      st        j                  dd|       |t        j                  |      r| j                  d|      S t	        j
                  | ||||      S )N	Bernoulliz,out parameter is not supported for bernoulliz(generator is not supported for bernoulli)r   r   _unimplementedr   r   	bernoulli)r
   inputp	generatorouts        r   r$   r$   9   s    
77<&&G	
 _%=%=i%H&&CU	
 	yO,,Q/ttK''AuaC88r   zprim::unchecked_castc                 z    t        |j                         t        j                        r| j	                  d|      S |S )NOptionalGetElement)r   r   r   r   r   )r
   r   s     r   prim_unchecked_castr+   H   s/    
 $))+r/tt($//Kr   )NNN)__doc__	functoolsr   r   
torch.onnxr   r   r   torch.onnx._internalr   r   partialonnx_symbolic_onnx_symbolicGraphContextr   wrap_logical_op_with_negationr    r$   r+    r   r   <module>r6      s   6    A 8 #""<#=#=RH %'' % %  !%%%I** % & "% !"9'' 9 #9 &'911  (r   