o
    wZh8                     @   s   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dZedd	e	jfd
dZedejd	e	jfddZeddd	e	jfddZedd	e	jfddZdS )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   )Zopsetzaten::__is_gc                 C   sV   t |r$t| tjr| d|}| d|S | jdtdgdS t	
| ||S )NZOptionalHasElementNotConstantr   )Zvalue_t)r   _is_none
isinstancetyper   OptionalTypeoptorchZ
BoolTensoropset9eq)r   selfothernone r   J/var/www/auris/lib/python3.10/site-packages/torch/onnx/symbolic_opset15.py	aten__is_(   s   
r   zaten::__isnot_c                 C   s   t | ||S )N)r   )r   r   r   r   r   r   aten__isnot_3   s   r   zaten::bernoullic                 C   sp   |d urt |st dd| |d ur t |s t dd| |d u s)t |r/| d|S t| ||||S )NZ	Bernoulliz,out parameter is not supported for bernoulliz(generator is not supported for bernoulli)r   r   Z_unimplementedr   r   	bernoulli)r   inputp	generatoroutr   r   r   r   9   s   r   zprim::unchecked_castc                 C   s    t | tjr| d|S |S )NZOptionalGetElement)r   r   r   r   r   )r   r   r   r   r   prim_unchecked_castH   s   r   )NNN)__doc__	functoolsr   r   Z
torch.onnxr   r   r   Ztorch.onnx._internalr   r   partialZonnx_symbolicZ_onnx_symbolicZGraphContextr   Zwrap_logical_op_with_negationr   r   r   r   r   r   r   <module>   s    
