Celu#

  • Domain: ai.onnx

  • Since version: 28

Continuously Differentiable Exponential Linear Units: Perform the linear unit element-wise on the input tensor X using formula:

max(0,x) + min(0,alpha*(exp(x/alpha)-1))

Inputs

  • X (T): Input tensor

Outputs

  • Y (T): Output tensor

Attributes

  • alpha (float): The Alpha value in Celu formula which control the shape of the unit. The default value is 1.0.

Type Constraints

  • T: Constrain input and output types to float tensors. Allowed types: tensor(bfloat16), tensor(double), tensor(float), tensor(float16).

Examples#

test_cc_celu_bfloat16

Node:
  Celu(X) -> (Y)
  Attributes:
    alpha = 1.0
Inputs:
  X: shape=(2, 3), dtype=bfloat16
    [[-3, -1, 0],
     [1, 2, 3]]

Outputs:
  Y: shape=(2, 3), dtype=bfloat16
    [[-0.949219, -0.632812, 0],
     [1, 2, 3]]

test_cc_celu_float16

Node:
  Celu(X) -> (Y)
  Attributes:
    alpha = 2.0
Inputs:
  X: shape=(2, 3), dtype=float16
    [[-3., -1.,  0.],
     [ 1.,  2.,  3.]]

Outputs:
  Y: shape=(2, 3), dtype=float16
    [[-1.554, -0.787,  0.   ],
     [ 1.   ,  2.   ,  3.   ]]

Differences with previous version (12)#

SchemaDiff: Celu (domain 'ai.onnx')

  • old version: 12

  • new version: 28

  • breaking: no

Type constraints:

  • changed ‘T’: added types: [‘tensor(bfloat16)’, ‘tensor(double)’, ‘tensor(float16)’]

Version History#