
     TiR                        S SK Jr  S SKJrJrJrJrJr  S SKJ	r	  S SK
Jr  S SKJr  S SKJrJrJrJrJrJrJrJrJrJrJrJrJrJrJr  S SKJrJ r    " S S	\5      r!g
)    )annotations)OptionalSequenceTupleTypeVarUnion)
get_schema)	TypeAlias)Opset6)BOOL	COMPLEX64
COMPLEX128DOUBLEFLOATFLOAT16INT8INT16INT32INT64STRINGUINT8UINT16UINT32UINT64)OpOpsetc                     \ rS rSr% S r\" S\\\5      r	SZS jr
\" S\\\\\\\5      rS[S jr\rS\S'   \rS\S	'   S\S
 jr\" S\\\5      rS]S jr\" S\\\5      rS^S jr\" S\\\5      rSSSSS.             S_S jjr\" S\\\5      rSSSS.                 S`S jjr\" S\\\5      rSaS jr\" S\\\\\\\5      r SbS jr!\" S\\\5      r"S S!.ScS" jjr#\" S#\\\5      r$\r%S\S$'   SdS% jr&\" S&\\\5      r'\r(S\S''      SeSSSSS(SSS).                           SfS* jjjr)\" S+\\\5      r*S,S,SSS-.               SgS. jjr+\" S/\\\5      r,\r-S\S0'   ShS1 jr.\" S2\\\5      r/\r0S\S3'        SiSSSSS(SSS4.                               SjS5 jjjr1\" S6\\\5      r2\r3S\S7'   SkS8 jr4\" S9\\\\\\\5      r5SlS: jr6\" S;\\\5      r7\8\\4   r9S\S<'   S=SSS>.         SmS? jjr:\r;S\S@'   \r<S\SA'   SnSB jr=\" SC\\\5      r>SoSD jr?\" SE\\\5      r@SpSF jrA\" SG\\\5      rB\rCS\SH'      SeSSSISS(SSJ.                         SqSK jjjrD\" SL\\\5      rESrSM jrF\" SN\\\\\\\5      rGSsSO jrH\" SP\\\5      rIStSQ jrJ\" SR\\K\L\\\\M\\\N\O\P\\\Q5      rRSSST.       SuSU jjrS\rTS\SV'   \rUS\SW'   SvSX jrVSYrWg)wOpset7)   c                2    [         R                  " U SS5      $ )N    )r   __new__)clss    a/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/onnxscript/onnx_opset/_impl/opset7.pyr#   Opset7.__new__*   s    }}S"a((    T_Acosc                ^    [        SSS5      n[        U SU5      nU" U R                  X!5      6 $ )u   [🌐 Acos(7)](https://onnx.ai/onnx/operators/onnx__Acos.html#acos-7 "Online Documentation")


Calculates the arccosine (inverse of cosine) of the given input tensor, element-wise.


Args:
    input: (differentiable) Input tensor
Acosr"   r!   r	   r   _prepare_inputsselfinputschemaops       r%   r*   Opset7.Acos/   6     FAr*ff%4''677r'   T_Addc                `    [        SSS5      n[        U SU5      nU" U R                  X1U5      6 $ )u  [🌐 Add(7)](https://onnx.ai/onnx/operators/onnx__Add.html#add-7 "Online Documentation")


Performs element-wise binary addition (with Numpy-style broadcasting support).

This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.


Args:
    A: First operand.

    B: Second operand.
Addr"   r!   r+   r.   ABr0   r1   s        r%   r6   
Opset7.Add@   8     E1b)eV$4''1566r'   r
   T_AndT1_Andc                `    [        SSS5      n[        U SU5      nU" U R                  X1U5      6 $ )u^  [🌐 And(7)](https://onnx.ai/onnx/operators/onnx__And.html#and-7 "Online Documentation")


Returns the tensor resulted from performing the `and` logical operation
elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).

This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.


Args:
    A: (non-differentiable) First input operand for the logical operator.

    B: (non-differentiable) Second input operand for the logical operator.
Andr"   r!   r+   r7   s        r%   r?   
Opset7.AndW   8      E1b)eV$4''1566r'   T_Asinc                ^    [        SSS5      n[        U SU5      nU" U R                  X!5      6 $ )u   [🌐 Asin(7)](https://onnx.ai/onnx/operators/onnx__Asin.html#asin-7 "Online Documentation")


Calculates the arcsine (inverse of sine) of the given input tensor, element-wise.


Args:
    input: (differentiable) Input tensor
Asinr"   r!   r+   r-   s       r%   rD   Opset7.Asinm   r3   r'   T_Atanc                ^    [        SSS5      n[        U SU5      nU" U R                  X!5      6 $ )u   [🌐 Atan(7)](https://onnx.ai/onnx/operators/onnx__Atan.html#atan-7 "Online Documentation")


Calculates the arctangent (inverse of tangent) of the given input tensor, element-wise.


Args:
    input: (differentiable) Input tensor
Atanr"   r!   r+   r-   s       r%   rH   Opset7.Atan~   r3   r'   T_AveragePoolNOTSETr   N)auto_padcount_include_padpadsstridesc          	     l    [        SSS5      n[        U SU5      nU" U R                  Xq5      UUUUUS.6$ )u  [🌐 AveragePool(7)](https://onnx.ai/onnx/operators/onnx__AveragePool.html#averagepool-7 "Online Documentation")


 AveragePool consumes an input tensor X and applies average pooling across
 the tensor according to kernel sizes, stride sizes, and pad lengths.
 average pooling consisting of computing the average on all values of a
 subset of the input tensor according to the kernel size and downsampling the
 data into the output tensor Y for further processing. The output spatial shape will be following:
 ```
 output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)

 * pad_shape[i] is sum of pads along axis i
 ```

 `auto_pad` is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following:
 ```
 VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - kernel_spatial_shape[i] + 1) / strides_spatial_shape[i])
 SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])
 ```
 And pad shape will be following if `SAME_UPPER` or `SAME_LOWER`:
 ```
 pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + kernel_spatial_shape[i] - input_spatial_shape[i]
 ```
 The output of each pooling window is divided by the number of elements (exclude pad when attribute count_include_pad is zero).


Args:
    X: Input data tensor from the previous operator; dimensions for image case
        are (N x C x H x W), where N is the batch size, C is the number of
        channels, and H and W are the height and the width of the data. For non
        image case, the dimensions are in the form of (N x C x D1 x D2 ... Dn),
        where N is the batch size. Optionally, if dimension denotation is in
        effect, the operation expects the input data tensor to arrive with the
        dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE,
        DATA_FEATURE ...].

    auto_pad: auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID.
        Where default value is NOTSET, which means explicit padding is used.
        SAME_UPPER or SAME_LOWER mean pad the input so that the output spatial
        size match the input.In case of odd number add the extra padding at the
        end for SAME_UPPER and at the beginning for SAME_LOWER. VALID mean no
        padding.

    count_include_pad: Whether include pad pixels when calculating values for
        the edges. Default is 0, doesn't count include pad.

    kernel_shape: The size of the kernel along each axis.

    pads: Padding for the beginning and ending along each spatial axis, it can
        take any value greater than or equal to 0. The value represent the
        number of pixels added to the beginning and end part of the
        corresponding axis. `pads` format should be as follow [x1_begin,
        x2_begin...x1_end, x2_end,...], where xi_begin the number of pixels
        added at the beginning of axis `i` and xi_end, the number of pixels
        added at the end of axis `i`. This attribute cannot be used
        simultaneously with auto_pad attribute. If not present, the padding
        defaults to 0 along start and end of each spatial axis.

    strides: Stride along each spatial axis.
AveragePoolr"   r!   )rL   rM   kernel_shaperN   rO   r+   )	r.   XrL   rM   rR   rN   rO   r0   r1   s	            r%   rQ   Opset7.AveragePool   sK    N M1b1mV,!!&,/%
 	
r'   T_BatchNormalizationg   >g   ?   epsilonmomentumspatialc          
     l    [        SSS5      n	[        U SU	5      n
U
" U R                  XX#XE5      UUUS.6$ )uo	  [🌐 BatchNormalization(7)](https://onnx.ai/onnx/operators/onnx__BatchNormalization.html#batchnormalization-7 "Online Documentation")


    Carries out batch normalization as described in the paper
    https://arxiv.org/abs/1502.03167. Depending on the mode it is being run,
    there are multiple cases for the number of outputs, which we list below:

    Output case #1: Y, mean, var, saved_mean, saved_var (training mode)
    Output case #2: Y (test mode)
        This operator has **optional** inputs/outputs. See `ONNX <https://github.com/onnx/onnx/blob/master/docs/IR.md>`_ for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.


Args:
    X: Input data tensor from the previous operator; dimensions for image case
        are (N x C x H x W), where N is the batch size, C is the number of
        channels, and H and W are the height and the width of the data. For non
        image case, the dimensions are in the form of (N x C x D1 x D2 ... Dn),
        where N is the batch size.

    scale: If spatial is true, the dimension of scale is (C). If spatial is
        false, the dimensions of scale are (C x D1 x ... x Dn)

    B: If spatial is true, the dimension of bias is (C). If spatial is false,
        the dimensions of bias are (C x D1 x ... x Dn)

    mean: If spatial is true, the dimension of the running mean (training) or
        the estimated mean (testing) is (C). If spatial is false, the dimensions
        of the running mean (training) or the estimated mean (testing) are (C x
        D1 x ... x Dn).

    var: If spatial is true, the dimension of the running variance(training) or
        the estimated variance (testing) is (C). If spatial is false, the
        dimensions of the running variance(training) or the estimated variance
        (testing) are (C x D1 x ... x Dn).

    epsilon: The epsilon value to use to avoid division by zero.

    momentum: Factor used in computing the running mean and variance.e.g.,
        running_mean = running_mean * momentum + mean * (1 - momentum).

    spatial: If true, compute the mean and variance across per activation. If
        false, compute the mean and variance across per feature over each
        mini-batch.
BatchNormalizationr"   r!   rW   r+   )r.   rS   scaler9   meanvarrX   rY   rZ   r0   r1   s              r%   r\   Opset7.BatchNormalization   sK    ~ 0!R8*F3!!&UtA	
 	
r'   T_Cosc                ^    [        SSS5      n[        U SU5      nU" U R                  X!5      6 $ )u   [🌐 Cos(7)](https://onnx.ai/onnx/operators/onnx__Cos.html#cos-7 "Online Documentation")


Calculates the cosine of the given input tensor, element-wise.


Args:
    input: (differentiable) Input tensor
Cosr"   r!   r+   r-   s       r%   rc   
Opset7.Cos-  6     E1b)eV$4''677r'   T_Divc                `    [        SSS5      n[        U SU5      nU" U R                  X1U5      6 $ )u  [🌐 Div(7)](https://onnx.ai/onnx/operators/onnx__Div.html#div-7 "Online Documentation")


Performs element-wise binary division (with Numpy-style broadcasting support).

This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.


Args:
    A: First operand.

    B: Second operand.
Divr"   r!   r+   r7   s        r%   rh   
Opset7.Div>  r;   r'   	T_Dropoutg      ?)ratioc               d    [        SSS5      n[        U SU5      nU" U R                  X15      SU06$ )u  [🌐 Dropout(7)](https://onnx.ai/onnx/operators/onnx__Dropout.html#dropout-7 "Online Documentation")


Dropout takes one input data (Tensor<float>) and produces two Tensor outputs,
output (Tensor<float>) and mask (Tensor<bool>). Depending on whether it is in
test mode or not, the output Y will either be a random dropout, or a simple
copy of the input. Note that our implementation of Dropout does scaling in
the training phase, so during testing nothing needs to be done.
This operator has **optional** inputs/outputs. See `ONNX <https://github.com/onnx/onnx/blob/master/docs/IR.md>`_ for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.


Args:
    data: The input data as Tensor.

    ratio: The ratio of random dropout
Dropoutr"   r!   rk   r+   )r.   datark   r0   r1   s        r%   rm   Opset7.DropoutS  s;    $ Iq"-i(4''5CUCCr'   T_EqualT1_Equalc                `    [        SSS5      n[        U SU5      nU" U R                  X1U5      6 $ )u<  [🌐 Equal(7)](https://onnx.ai/onnx/operators/onnx__Equal.html#equal-7 "Online Documentation")


Returns the tensor resulted from performing the `equal` logical operation
elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).

This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.


Args:
    A: First input operand for the logical operator.

    B: Second input operand for the logical operator.
Equalr"   r!   r+   r7   s        r%   rs   Opset7.Equalm  s8      GQ+gv&4''1566r'   T_GRUT1_GRUforwardactivation_alphaactivation_betaactivationsclip	directionhidden_sizelinear_before_resetc               v    [        SSS5      n[        U SU5      nU" U R                  XX#XEU5      UUU	U
UUUS.6$ )u  [🌐 GRU(7)](https://onnx.ai/onnx/operators/onnx__GRU.html#gru-7 "Online Documentation")


Computes an one-layer GRU. This operator is usually supported via some custom
implementation such as CuDNN.

Notations:

`X` - input tensor

`z` - update gate

`r` - reset gate

`h` - hidden gate

`t` - time step (t-1 means previous time step)

`W[zrh]` - W parameter weight matrix for update, reset, and hidden gates

`R[zrh]` - R recurrence weight matrix for update, reset, and hidden gates

`Wb[zrh]` - W bias vectors for update, reset, and hidden gates

`Rb[zrh]` - R bias vectors for update, reset, and hidden gates

`WB[zrh]` - W parameter weight matrix for backward update, reset, and hidden gates

`RB[zrh]` - R recurrence weight matrix for backward update, reset, and hidden gates

`WBb[zrh]` - W bias vectors for backward update, reset, and hidden gates

`RBb[zrh]` - R bias vectors for backward update, reset, and hidden gates

`H` - Hidden state

`num_directions` - 2 if direction == bidirectional else 1

Activation functions:

  Relu(x)                - max(0, x)

  Tanh(x)                - (1 - e^{-2x})/(1 + e^{-2x})

  Sigmoid(x)             - 1/(1 + e^{-x})

  (NOTE: Below are optional)

  Affine(x)              - alpha*x + beta

  LeakyRelu(x)           - x if x >= 0 else alpha * x

  ThresholdedRelu(x)     - x if x >= alpha else 0

  ScaledTanh(x)          - alpha*Tanh(beta*x)

  HardSigmoid(x)         - min(max(alpha*x + beta, 0), 1)

  Elu(x)                 - x if x >= 0 else alpha*(e^x - 1)

  Softsign(x)            - x/(1 + |x|)

  Softplus(x)            - log(1 + e^x)

Equations (Default: f=Sigmoid, g=Tanh):

  - zt = f(Xt*(Wz^T) + Ht-1*(Rz^T) + Wbz + Rbz)

  - rt = f(Xt*(Wr^T) + Ht-1*(Rr^T) + Wbr + Rbr)

  - ht = g(Xt*(Wh^T) + (rt (.) Ht-1)*(Rh^T) + Rbh + Wbh) # default, when linear_before_reset = 0

  - ht = g(Xt*(Wh^T) + (rt (.) (Ht-1*(Rh^T) + Rbh)) + Wbh) # when linear_before_reset != 0

  - Ht = (1 - zt) (.) ht + zt (.) Ht-1
This operator has **optional** inputs/outputs. See `ONNX <https://github.com/onnx/onnx/blob/master/docs/IR.md>`_ for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.


Args:
    X: The input sequences packed (and potentially padded) into one 3-D tensor
        with the shape of `[seq_length, batch_size, input_size]`.

    W: The weight tensor for the gates. Concatenation of `W[zrh]` and `WB[zrh]`
        (if bidirectional) along dimension 0. This tensor has shape
        `[num_directions, 3*hidden_size, input_size]`.

    R: The recurrence weight tensor. Concatenation of `R[zrh]` and `RB[zrh]` (if
        bidirectional) along dimension 0. This tensor has shape
        `[num_directions, 3*hidden_size, hidden_size]`.

    B: (optional) The bias tensor for the gates. Concatenation of `[Wb[zrh],
        Rb[zrh]]` and `[WBb[zrh], RBb[zrh]]` (if bidirectional) along dimension
        0. This tensor has shape `[num_directions, 6*hidden_size]`. Optional: If
        not specified - assumed to be 0

    sequence_lens: (optional) Optional tensor specifying lengths of the
        sequences in a batch. If not specified - assumed all sequences in the
        batch to have length `seq_length`. It has shape `[batch_size]`.

    initial_h: (optional) Optional initial value of the hidden. If not specified
        - assumed to be 0. It has shape `[num_directions, batch_size,
        hidden_size]`.

    activation_alpha: Optional scaling values used by some activation functions.
        The values are consumed in the order of activation functions, for
        example (f, g, h) in LSTM. Default values are the same as of
        corresponding ONNX operators.For example with LeakyRelu, the default
        alpha is 0.01.

    activation_beta: Optional scaling values used by some activation functions.
        The values are consumed in the order of activation functions, for
        example (f, g, h) in LSTM. Default values are the same as of
        corresponding ONNX operators.

    activations: A list of 2 (or 4 if bidirectional) activation functions for
        update, reset, and hidden gates. The activation functions must be one of
        the activation functions specified above. Optional: See the equations
        for default if not specified.

    clip: Cell clip threshold. Clipping bounds the elements of a tensor in the
        range of [-threshold, +threshold] and is applied to the input of
        activations. No clip if not specified.

    direction: Specify if the RNN is forward, reverse, or bidirectional. Must be
        one of forward (default), reverse, or bidirectional.

    hidden_size: Number of neurons in the hidden layer

    linear_before_reset: When computing the output of the hidden gate, apply the
        linear transformation before multiplying by the output of the reset
        gate.
GRUr"   r!   rx   r+   )r.   rS   WRr9   sequence_lens	initial_hry   rz   r{   r|   r}   r~   r   r0   r1   s                   r%   r   
Opset7.GRU  sW    l E1b)eV$!!&Q1YO-+## 3	
 		
r'   T_Gemmg      ?alphabetatransAtransBc               l    [        SSS5      n[        U SU5      n	U	" U R                  XX#5      UUUUS.6$ )u[  [🌐 Gemm(7)](https://onnx.ai/onnx/operators/onnx__Gemm.html#gemm-7 "Online Documentation")

General Matrix multiplication:
https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms#Level_3

A' = transpose(A) if transA else A

B' = transpose(B) if transB else B

Compute Y = alpha * A' * B' + beta * C, where input tensor A has shape (M, K) or (K, M),
input tensor B has shape (K, N) or (N, K), input tensor C is broadcastable to shape (M, N),
and output tensor Y has shape (M, N). A will be transposed before doing the
computation if attribute transA is non-zero, same for B and transB.
This operator supports **unidirectional broadcasting** (tensor C should be unidirectional broadcastable to tensor A * B); for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.

Args:
    A: Input tensor A. The shape of A should be (M, K) if transA is 0, or (K, M)
        if transA is non-zero.

    B: Input tensor B. The shape of B should be (K, N) if transB is 0, or (N, K)
        if transB is non-zero.

    C: Input tensor C. The shape of C should be unidirectional broadcastable to
        (M, N).

    alpha: Scalar multiplier for the product of input tensors A * B.

    beta: Scalar multiplier for input tensor C.

    transA: Whether A should be transposed

    transB: Whether B should be transposed
Gemmr"   r!   r   r+   )
r.   r8   r9   Cr   r   r   r   r0   r1   s
             r%   r   Opset7.Gemm*  sJ    Z FAr*ff%!!&Q2
 	
r'   	T_Greater
T1_Greaterc                `    [        SSS5      n[        U SU5      nU" U R                  X1U5      6 $ )uD  [🌐 Greater(7)](https://onnx.ai/onnx/operators/onnx__Greater.html#greater-7 "Online Documentation")


Returns the tensor resulted from performing the `greater` logical operation
elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).

This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.


Args:
    A: First input operand for the logical operator.

    B: Second input operand for the logical operator.
Greaterr"   r!   r+   r7   s        r%   r   Opset7.Greatere  s8      Iq"-i(4''1566r'   T_LSTMT1_LSTMry   rz   r{   r|   r}   r~   input_forgetc	               x    [        SSS5      n[        U SU5      nU" U R                  UXX4XVXx5	      U	U
UUUUUS.6$ )u  [🌐 LSTM(7)](https://onnx.ai/onnx/operators/onnx__LSTM.html#lstm-7 "Online Documentation")


Computes an one-layer LSTM. This operator is usually supported via some
custom implementation such as CuDNN.

Notations:

`X` - input tensor

`i` - input gate

`o` - output gate

`f` - forget gate

`c` - cell gate

`t` - time step (t-1 means previous time step)

`W[iofc]` - W parameter weight matrix for input, output, forget, and cell gates

`R[iofc]` - R recurrence weight matrix for input, output, forget, and cell gates

`Wb[iofc]` - W bias vectors for input, output, forget, and cell gates

`Rb[iofc]` - R bias vectors for input, output, forget, and cell gates

`P[iof]`  - P peephole weight vector for input, output, and forget gates

`WB[iofc]` - W parameter weight matrix for backward input, output, forget, and cell gates

`RB[iofc]` - R recurrence weight matrix for backward input, output, forget, and cell gates

`WBb[iofc]` - W bias vectors for backward input, output, forget, and cell gates

`RBb[iofc]` - R bias vectors for backward input, output, forget, and cell gates

`PB[iof]`  - P peephole weight vector for backward input, output, and forget gates

`H` - Hidden state

`num_directions` - 2 if direction == bidirectional else 1

Activation functions:

  Relu(x)                - max(0, x)

  Tanh(x)                - (1 - e^{-2x})/(1 + e^{-2x})

  Sigmoid(x)             - 1/(1 + e^{-x})

  (NOTE: Below are optional)

  Affine(x)              - alpha*x + beta

  LeakyRelu(x)           - x if x >= 0 else alpha * x

  ThresholdedRelu(x)     - x if x >= alpha else 0

  ScaledTanh(x)          - alpha*Tanh(beta*x)

  HardSigmoid(x)         - min(max(alpha*x + beta, 0), 1)

  Elu(x)                 - x if x >= 0 else alpha*(e^x - 1)

  Softsign(x)            - x/(1 + |x|)

  Softplus(x)            - log(1 + e^x)

Equations (Default: f=Sigmoid, g=Tanh, h=Tanh):

  - it = f(Xt*(Wi^T) + Ht-1*(Ri^T) + Pi (.) Ct-1 + Wbi + Rbi)

  - ft = f(Xt*(Wf^T) + Ht-1*(Rf^T) + Pf (.) Ct-1 + Wbf + Rbf)

  - ct = g(Xt*(Wc^T) + Ht-1*(Rc^T) + Wbc + Rbc)

  - Ct = ft (.) Ct-1 + it (.) ct

  - ot = f(Xt*(Wo^T) + Ht-1*(Ro^T) + Po (.) Ct + Wbo + Rbo)

  - Ht = ot (.) h(Ct)
This operator has **optional** inputs/outputs. See `ONNX <https://github.com/onnx/onnx/blob/master/docs/IR.md>`_ for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.


Args:
    X: The input sequences packed (and potentially padded) into one 3-D tensor
        with the shape of `[seq_length, batch_size, input_size]`.

    W: The weight tensor for the gates. Concatenation of `W[iofc]` and
        `WB[iofc]` (if bidirectional) along dimension 0. The tensor has shape
        `[num_directions, 4*hidden_size, input_size]`.

    R: The recurrence weight tensor. Concatenation of `R[iofc]` and `RB[iofc]`
        (if bidirectional) along dimension 0. This tensor has shape
        `[num_directions, 4*hidden_size, hidden_size]`.

    B: (optional) The bias tensor for input gate. Concatenation of `[Wb[iofc],
        Rb[iofc]]`, and `[WBb[iofc], RBb[iofc]]` (if bidirectional) along
        dimension 0. This tensor has shape `[num_directions, 8*hidden_size]`.
        Optional: If not specified - assumed to be 0.

    sequence_lens: (optional) Optional tensor specifying lengths of the
        sequences in a batch. If not specified - assumed all sequences in the
        batch to have length `seq_length`. It has shape `[batch_size]`.

    initial_h: (optional) Optional initial value of the hidden. If not specified
        - assumed to be 0. It has shape `[num_directions, batch_size,
        hidden_size]`.

    initial_c: (optional) Optional initial value of the cell. If not specified -
        assumed to be 0. It has shape `[num_directions, batch_size,
        hidden_size]`.

    P: (optional) The weight tensor for peepholes. Concatenation of `P[iof]` and
        `PB[iof]` (if bidirectional) along dimension 0. It has shape
        `[num_directions, 3*hidde_size]`. Optional: If not specified - assumed
        to be 0.

    activation_alpha: Optional scaling values used by some activation functions.
        The values are consumed in the order of activation functions, for
        example (f, g, h) in LSTM. Default values are the same as of
        corresponding ONNX operators.For example with LeakyRelu, the default
        alpha is 0.01.

    activation_beta: Optional scaling values used by some activation functions.
        The values are consumed in the order of activation functions, for
        example (f, g, h) in LSTM. Default values are the same as of
        corresponding ONNX operators.

    activations: A list of 3 (or 6 if bidirectional) activation functions for
        input, output, forget, cell, and hidden. The activation functions must
        be one of the activation functions specified above. Optional: See the
        equations for default if not specified.

    clip: Cell clip threshold. Clipping bounds the elements of a tensor in the
        range of [-threshold, +threshold] and is applied to the input of
        activations. No clip if not specified.

    direction: Specify if the RNN is forward, reverse, or bidirectional. Must be
        one of forward (default), reverse, or bidirectional.

    hidden_size: Number of neurons in the hidden layer

    input_forget: Couple the input and forget gates if 1.
LSTMr"   r!   r   r+   )r.   rS   r   r   r9   r   r   	initial_cPry   rz   r{   r|   r}   r~   r   r0   r1   s                     r%   r   Opset7.LSTM}  sZ    N FAr*ff%!!&!mPY]-+##%	
 		
r'   T_LessT1_Lessc                `    [        SSS5      n[        U SU5      nU" U R                  X1U5      6 $ )u8  [🌐 Less(7)](https://onnx.ai/onnx/operators/onnx__Less.html#less-7 "Online Documentation")


Returns the tensor resulted from performing the `less` logical operation
elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).

This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.


Args:
    A: First input operand for the logical operator.

    B: Second input operand for the logical operator.
Lessr"   r!   r+   r7   s        r%   r   Opset7.Less5  s8      FAr*ff%4''1566r'   T_Mulc                `    [        SSS5      n[        U SU5      nU" U R                  X1U5      6 $ )u  [🌐 Mul(7)](https://onnx.ai/onnx/operators/onnx__Mul.html#mul-7 "Online Documentation")


Performs element-wise binary multiplication (with Numpy-style broadcasting support).

This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.


Args:
    A: First operand.

    B: Second operand.
Mulr"   r!   r+   r7   s        r%   r   
Opset7.MulK  r;   r'   T1_MultinomialT2_Multinomial   dtypesample_sizeseedc               h    [        SSS5      n[        U SU5      nU" U R                  XQ5      UUUS.6$ )u  [🌐 Multinomial(7)](https://onnx.ai/onnx/operators/onnx__Multinomial.html#multinomial-7 "Online Documentation")


Generate a tensor of samples from a multinomial distribution according to the probabilities
of each of the possible outcomes.


Args:
    input: Input tensor with shape [batch_size, class_size], where class_size is
        the number of all possible outcomes. Each value along the axis zero
        represents the unnormalized log-probability of each corresponding
        outcome in a batch.

    dtype: (Optional) The data type for the elements of the output tensor, if
        not specified, we will use int32.

    sample_size: Number of times to sample.

    seed: (Optional) Seed to the random generator, if not specified we will auto
        generate one.
Multinomialr"   r!   r   r+   )r.   r/   r   r   r   r0   r1   s          r%   r   Opset7.Multinomialb  sD    < M1b1mV,!!&0#	
 	
r'   T_OrT1_Orc                `    [        SSS5      n[        U SU5      nU" U R                  X1U5      6 $ )uZ  [🌐 Or(7)](https://onnx.ai/onnx/operators/onnx__Or.html#or-7 "Online Documentation")


Returns the tensor resulted from performing the `or` logical operation
elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).

This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.


Args:
    A: (non-differentiable) First input operand for the logical operator.

    B: (non-differentiable) Second input operand for the logical operator.
Orr"   r!   r+   r7   s        r%   r   	Opset7.Or  s8      D!R(dF#4''1566r'   T_PReluc                `    [        SSS5      n[        U SU5      nU" U R                  X1U5      6 $ )u  [🌐 PRelu(7)](https://onnx.ai/onnx/operators/onnx__PRelu.html#prelu-7 "Online Documentation")


PRelu takes input data (Tensor<T>) and slope tensor as input, and produces one
output data (Tensor<T>) where the function `f(x) = slope * x for x < 0`,
`f(x) = x for x >= 0`., is applied to the data tensor elementwise.
This operator supports **unidirectional broadcasting** (tensor slope should be unidirectional broadcastable to input tensor X); for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.

Args:
    X: Input tensor

    slope: Slope tensor. The shape of slope can be smaller than first input X;
        if so, its shape must be unidirectional broadcastable to X
PRelur"   r!   r+   )r.   rS   sloper0   r1   s        r%   r   Opset7.PRelu  s8      GQ+gv&4''59::r'   T_Powc                `    [        SSS5      n[        U SU5      nU" U R                  X1U5      6 $ )u5  [🌐 Pow(7)](https://onnx.ai/onnx/operators/onnx__Pow.html#pow-7 "Online Documentation")


Pow takes input data (Tensor<T>) and exponent Tensor, and
produces one output data (Tensor<T>) where the function `f(x) = x^exponent`,
is applied to the data tensor elementwise.
This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.

Args:
    X: First operand, base of the exponent.

    Y: Second operand, power of the exponent.
Powr"   r!   r+   )r.   rS   Yr0   r1   s        r%   r   
Opset7.Pow  r;   r'   T_RNNT1_RNN)Tanhr   ry   rz   r{   r|   r}   r~   c               t    [        SSS5      n[        U SU5      nU" U R                  XX#XEU5      UUU	U
UUS.6$ )up  [🌐 RNN(7)](https://onnx.ai/onnx/operators/onnx__RNN.html#rnn-7 "Online Documentation")


Computes an one-layer simple RNN. This operator is usually supported
via some custom implementation such as CuDNN.

Notations:

`X` - input tensor

`i` - input gate

`t` - time step (t-1 means previous time step)

`Wi` - W parameter weight matrix for input gate

`Ri` - R recurrence weight matrix for input gate

`Wbi` - W parameter bias vector for input gate

`Rbi` - R parameter bias vector for input gate

`WBi` - W parameter weight matrix for backward input gate

`RBi` - R recurrence weight matrix for backward input gate

`WBbi` - WR bias vectors for backward input gate

`RBbi` - RR bias vectors for backward input gate

`H` - Hidden state

`num_directions` - 2 if direction == bidirectional else 1

Activation functions:

  Relu(x)                - max(0, x)

  Tanh(x)                - (1 - e^{-2x})/(1 + e^{-2x})

  Sigmoid(x)             - 1/(1 + e^{-x})

  (NOTE: Below are optional)

  Affine(x)              - alpha*x + beta

  LeakyRelu(x)           - x if x >= 0 else alpha * x

  ThresholdedRelu(x)     - x if x >= alpha else 0

  ScaledTanh(x)          - alpha*Tanh(beta*x)

  HardSigmoid(x)         - min(max(alpha*x + beta, 0), 1)

  Elu(x)                 - x if x >= 0 else alpha*(e^x - 1)

  Softsign(x)            - x/(1 + |x|)

  Softplus(x)            - log(1 + e^x)

Equations (Default: f=Tanh):

  - Ht = f(Xt*(Wi^T) + Ht-1*(Ri^T) + Wbi + Rbi)
This operator has **optional** inputs/outputs. See `ONNX <https://github.com/onnx/onnx/blob/master/docs/IR.md>`_ for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.


Args:
    X: The input sequences packed (and potentially padded) into one 3-D tensor
        with the shape of `[seq_length, batch_size, input_size]`.

    W: The weight tensor for input gate. Concatenation of `Wi` and `WBi` (if
        bidirectional). The tensor has shape `[num_directions, hidden_size,
        input_size]`.

    R: The recurrence weight tensor. Concatenation of `Ri` and `RBi` (if
        bidirectional). The tensor has shape `[num_directions, hidden_size,
        hidden_size]`.

    B: (optional) The bias tensor for input gate. Concatenation of `[Wbi, Rbi]`
        and `[WBbi, RBbi]` (if bidirectional). The tensor has shape
        `[num_directions, 2*hidden_size]`. Optional: If not specified - assumed
        to be 0.

    sequence_lens: (optional) Optional tensor specifying lengths of the
        sequences in a batch. If not specified - assumed all sequences in the
        batch to have length `seq_length`. It has shape `[batch_size]`.

    initial_h: (optional) Optional initial value of the hidden. If not specified
        - assumed to be 0. It has shape `[num_directions, batch_size,
        hidden_size]`.

    activation_alpha: Optional scaling values used by some activation functions.
        The values are consumed in the order of activation functions, for
        example (f, g, h) in LSTM. Default values are the same as of
        corresponding ONNX operators.For example with LeakyRelu, the default
        alpha is 0.01.

    activation_beta: Optional scaling values used by some activation functions.
        The values are consumed in the order of activation functions, for
        example (f, g, h) in LSTM. Default values are the same as of
        corresponding ONNX operators.

    activations: One (or two if bidirectional) activation function for input
        gate. The activation function must be one of the activation functions
        specified above. Optional: Default `Tanh` if not specified.

    clip: Cell clip threshold. Clipping bounds the elements of a tensor in the
        range of [-threshold, +threshold] and is applied to the input of
        activations. No clip if not specified.

    direction: Specify if the RNN is forward, reverse, or bidirectional. Must be
        one of forward (default), reverse, or bidirectional.

    hidden_size: Number of neurons in the hidden layer
RNNr"   r!   r   r+   )r.   rS   r   r   r9   r   r   ry   rz   r{   r|   r}   r~   r0   r1   s                  r%   r   
Opset7.RNN  sT    H E1b)eV$!!&Q1YO-+##
 	
r'   T_Sinc                ^    [        SSS5      n[        U SU5      nU" U R                  X!5      6 $ )u   [🌐 Sin(7)](https://onnx.ai/onnx/operators/onnx__Sin.html#sin-7 "Online Documentation")


Calculates the sine of the given input tensor, element-wise.


Args:
    input: (differentiable) Input tensor
Sinr"   r!   r+   r-   s       r%   r   
Opset7.Sinb  re   r'   T_Subc                `    [        SSS5      n[        U SU5      nU" U R                  X1U5      6 $ )u  [🌐 Sub(7)](https://onnx.ai/onnx/operators/onnx__Sub.html#sub-7 "Online Documentation")


Performs element-wise binary subtraction (with Numpy-style broadcasting support).

This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.


Args:
    A: First operand.

    B: Second operand.
Subr"   r!   r+   r7   s        r%   r   
Opset7.Subs  r;   r'   T_Tanc                ^    [        SSS5      n[        U SU5      nU" U R                  X!5      6 $ )u   [🌐 Tan(7)](https://onnx.ai/onnx/operators/onnx__Tan.html#tan-7 "Online Documentation")


Calculates the tangent of the given input tensor, element-wise.


Args:
    input: (differentiable) Input tensor
Tanr"   r!   r+   r-   s       r%   r   
Opset7.Tan  re   r'   
T_Upsamplenearest)modec               d    [        SSS5      n[        U SU5      nU" U R                  XA5      X#S.6$ )u0  [🌐 Upsample(7)](https://onnx.ai/onnx/operators/onnx__Upsample.html#upsample-7 "Online Documentation")


Upsample the input tensor.
Each dimension value of the output tensor is:
  output_dimension = floor(input_dimension * scale).


Args:
    X: N-D tensor

    mode: Two interpolation modes: nearest (default), and linear (including
        bilinear, trilinear, etc)

    scales: The scale array along each dimension. It takes value greater than or
        equal to 1. The number of elements of 'scales' should be the same as the
        rank of input 'X'.
Upsampler"   r!   )r   scalesr+   )r.   rS   r   r   r0   r1   s         r%   r   Opset7.Upsample  s8    , J2.j&)4''2MMr'   T_XorT1_Xorc                `    [        SSS5      n[        U SU5      nU" U R                  X1U5      6 $ )u^  [🌐 Xor(7)](https://onnx.ai/onnx/operators/onnx__Xor.html#xor-7 "Online Documentation")


Returns the tensor resulted from performing the `xor` logical operation
elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support).

This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>`_.


Args:
    A: (non-differentiable) First input operand for the logical operator.

    B: (non-differentiable) Second input operand for the logical operator.
Xorr"   r!   r+   r7   s        r%   r   
Opset7.Xor  rA   r'    )r/   r(   returnr(   )r8   r4   r9   r4   r   r4   )r8   r<   r9   r<   r   r=   )r/   rB   r   rB   )r/   rF   r   rF   )rS   rJ   rL   strrM   intrR   zSequence[int]rN   Optional[Sequence[int]]rO   r   r   rJ   )rS   rU   r]   rU   r9   rU   r^   rU   r_   rU   rX   floatrY   r   rZ   r   r   zsTuple[T_BatchNormalization, T_BatchNormalization, T_BatchNormalization, T_BatchNormalization, T_BatchNormalization])r/   ra   r   ra   )r8   rf   r9   rf   r   rf   )rn   rj   rk   r   r   zTuple[T_Dropout, T_Dropout])r8   rp   r9   rp   r   rq   )NNN)rS   ru   r   ru   r   ru   r9   Optional[T_GRU]r   zOptional[T1_GRU]r   r   ry   Optional[Sequence[float]]rz   r   r{   Optional[Sequence[str]]r|   Optional[float]r}   r   r~   Optional[int]r   r   r   zTuple[T_GRU, T_GRU])r8   r   r9   r   r   r   r   r   r   r   r   r   r   r   r   r   )r8   r   r9   r   r   r   )NNNNN) rS   r   r   r   r   r   r9   Optional[T_LSTM]r   zOptional[T1_LSTM]r   r   r   r   r   r   ry   r   rz   r   r{   r   r|   r   r}   r   r~   r   r   r   r   zTuple[T_LSTM, T_LSTM, T_LSTM])r8   r   r9   r   r   r   )r8   r   r9   r   r   r   )
r/   r   r   r   r   r   r   r   r   r   )r8   r   r9   r   r   r   )rS   r   r   r   r   r   )rS   r   r   r   r   r   )rS   r   r   r   r   r   r9   Optional[T_RNN]r   zOptional[T1_RNN]r   r   ry   r   rz   r   r{   zSequence[str]r|   r   r}   r   r~   r   r   zTuple[T_RNN, T_RNN])r/   r   r   r   )r8   r   r9   r   r   r   )r/   r   r   r   )rS   r   r   r   r   zSequence[float]r   r   )r8   r   r9   r   r   r   )X__name__
__module____qualname____firstlineno__r#   r   r   r   r   r(   r*   r   r   r   r   r4   r6   r   r<   __annotations__r=   r?   rB   rD   rF   rH   rJ   rQ   rU   r\   ra   rc   rf   rh   rj   rm   rp   rq   rs   ru   rv   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__r   r'   r%   r   r   )   s    ) Xvug6F8 GVUGUE66RE7& E9FI7( Xvug6F8 Xvug6F8 OVUGDM !!"(,+/P
P
 	P

 P
 $P
 &P
 )P
 
P
d ##965'R /,F
F
 $F
  	F

 #F
 "F
 F
 F
 F

F
P GVUG4E8 GVUGUE66RE7& VUG<I9< D, iue4GHi7( GVUG4EFI "*.%)a
 7;59/3 $"%)#$a
a
 a
 	a

 a
 (a
 #a
 4a
 3a
 -a
 a
 a
 #a
 !a
  
!a
F Xvug6F 5
5
 5
 	5
 5
 5
 5
 5
 
5
n VUG<I J	 7( Xvug6FGY #+/&*&*"r
 7;59/3 $"%)#r
r
 r
 	r

 r
 )r
 $r
 $r
 r
 4r
 3r
 -r
 r
 r
  #!r
" #r
$ 
'%r
h Xvug6FGY7( GVUGUE66RE7& -vugFN %eUl 3NI3  $%
%
 	%

 %
 %
 
%
N D)E97( i8G;( GVUG4E7& GVUG4EFI "*.%)N
 7;59%5 $"%)N
N
 N
 	N

 N
 (N
 #N
 4N
 3N
 #N
 N
 N
 #N
 
N
` GVUG4E8 GVUGUE66RE7& GVUG4E8 !J( -6NN&)N?NN	N4 E9FI7r'   r   N)"
__future__r   typingr   r   r   r   r   	onnx.defsr	   typing_extensionsr
   "onnxscript.onnx_opset._impl.opset6r   onnxscript.onnx_typesr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   onnxscript.valuesr   r   r   r   r'   r%   <module>r      sE    # < <   ' 5    " (q7V q7r'   