Exp#
Domain:
ai.onnxSince version: 13
Computes the Exp value of the input tensor element-wise.
Inputs
input (T): Input tensor
Outputs
output (T): The exponential of the input tensor computed element-wise
Type Constraints
T: Constrain input and output types to float tensors. Allowed types: tensor(bfloat16), tensor(double), tensor(float), tensor(float16).
Examples#
test_cc_exp
Node:
Exp(x) -> (y)
Inputs:
x: shape=(2, 3), dtype=float32
[[-2. , -1. , 0. ],
[ 0.5, 1. , 2. ]]
Outputs:
y: shape=(2, 3), dtype=float32
[[0.13533528, 0.36787945, 1. ],
[1.6487212 , 2.7182817 , 7.389056 ]]
test_cc_exp_bfloat16
Node:
Exp(x) -> (y)
Inputs:
x: shape=(2, 3), dtype=bfloat16
[[-2, -1, 0],
[0.5, 1, 2]]
Outputs:
y: shape=(2, 3), dtype=bfloat16
[[0.135742, 0.367188, 1],
[1.64844, 2.71875, 7.375]]
test_cc_exp_float16
Node:
Exp(x) -> (y)
Inputs:
x: shape=(2, 3), dtype=float16
[[-2. , -1. , 0. ],
[ 0.5, 1. , 2. ]]
Outputs:
y: shape=(2, 3), dtype=float16
[[0.1354, 0.368 , 1. ],
[1.648 , 2.719 , 7.39 ]]
test_exp
Node:
Exp(x) -> (y)
Inputs:
x: shape=(3, 4, 5), dtype=float32
[[[ 1.4243481 , -0.61890423, -0.5907667 , 1.4329695 , 0.5837956 ],
[-1.3854368 , 1.2791865 , 0.32735094, 0.6038593 , 0.24222691],
[-0.89236253, -1.1303798 , -0.09180629, -0.12591071, -1.2615176 ],
[-0.55638343, -0.747256 , -0.59118223, -0.9279915 , -0.73401135]],
[[ 1.1054384 , -0.69560546, -2.1534553 , 0.11396561, -0.8268097 ],
[ 1.2137318 , -0.22223468, 0.32949635, -0.21049212, 1.3518724 ],
[ 0.01262847, 0.6841954 , -1.2623075 , 0.20052178, -1.1255072 ],
[-0.6395738 , 1.5355366 , -1.1466801 , -0.42676184, -0.74427605]],
[[-1.5989435 , 2.3646672 , -1.0641551 , 0.90345967, -0.24993172],
[-1.784248 , -0.47239977, 0.09873669, -0.36464727, 0.6651279 ],
[-1.01641 , -0.39525023, 0.45574856, -0.3439513 , -0.5487247 ],
[ 0.06280329, -0.14411083, -1.1603392 , 0.49200374, -0.16951095]]]
Outputs:
y: shape=(3, 4, 5), dtype=float32
[[[ 4.1551485 , 0.5385342 , 0.55390245, 4.191126 , 1.7928305 ],
[ 0.2502145 , 3.593715 , 1.3872882 , 1.8291645 , 1.2740833 ],
[ 0.4096867 , 0.3229106 , 0.9122819 , 0.88169354, 0.28322387],
[ 0.5732786 , 0.47366452, 0.5536723 , 0.39534697, 0.47997975]],
[[ 3.0205483 , 0.49877238, 0.11608237, 1.1207136 , 0.43744263],
[ 3.3660223 , 0.8007274 , 1.3902677 , 0.81018543, 3.864655 ],
[ 1.0127085 , 1.9821763 , 0.28300023, 1.2220402 , 0.32448784],
[ 0.5275172 , 4.643817 , 0.31768972, 0.65261894, 0.4750781 ]],
[[ 0.20210993, 10.640497 , 0.34501925, 2.4681273 , 0.77885395],
[ 0.16792329, 0.6235042 , 1.1037756 , 0.69444156, 1.9447392 ],
[ 0.3618918 , 0.6735115 , 1.5773537 , 0.70896345, 0.5776861 ],
[ 1.0648173 , 0.8657918 , 0.31337985, 1.6355902 , 0.8440775 ]]]
test_exp_example
Node:
Exp(x) -> (y)
Inputs:
x: shape=(3,), dtype=float32
[-1., 0., 1.]
Outputs:
y: shape=(3,), dtype=float32
[0.36787945, 1. , 2.7182817 ]
Differences with previous version (6)#
SchemaDiff: Exp (domain 'ai.onnx')
old version: 6
new version: 13
breaking: no
Type constraints:
changed ‘T’: added types: [‘tensor(bfloat16)’]