elu.https.any.js (28187B)
1 // META: title=test WebNN API elu operation 2 // META: global=window 3 // META: variant=?cpu 4 // META: variant=?gpu 5 // META: variant=?npu 6 // META: script=../resources/utils.js 7 // META: timeout=long 8 9 'use strict'; 10 11 // https://www.w3.org/TR/webnn/#api-mlgraphbuilder-elu 12 // Calculate the exponential linear unit function (ELU) on the input tensor 13 // element-wise. The calculation follows the expression 14 // max(0, x) + alpha * (exp(min(0, x)) - 1). 15 // 16 // dictionary MLEluOptions { 17 // double alpha = 1; 18 // }; 19 // 20 // MLOperand elu(MLOperand input, optional MLEluOptions options = {}); 21 22 const eluTests = [ 23 { 24 'name': 'elu float32 positive 0D scalar default options', 25 'graph': { 26 'inputs': { 27 'eluInput': { 28 'data': [4.721739768981934], 29 'descriptor': {shape: [], dataType: 'float32'} 30 } 31 }, 32 'operators': [{ 33 'name': 'elu', 34 'arguments': [{'input': 'eluInput'}], 35 'outputs': 'eluOutput' 36 }], 37 'expectedOutputs': { 38 'eluOutput': { 39 'data': [4.721739768981934], 40 'descriptor': {shape: [], dataType: 'float32'} 41 } 42 } 43 } 44 }, 45 { 46 'name': 'elu float32 negative 0D scalar default options', 47 'graph': { 48 'inputs': { 49 'eluInput': { 50 'data': [-3.8663666248321533], 51 'descriptor': {shape: [], dataType: 'float32'} 52 } 53 }, 54 'operators': [{ 55 'name': 'elu', 56 'arguments': [{'input': 'eluInput'}], 57 'outputs': 'eluOutput' 58 }], 59 'expectedOutputs': { 60 'eluOutput': { 61 'data': [-0.9790657162666321], 62 'descriptor': {shape: [], dataType: 'float32'} 63 } 64 } 65 } 66 }, 67 { 68 'name': 'elu float32 1D constant tensor default options', 69 'graph': { 70 'inputs': { 71 'eluInput': { 72 'data': [ 73 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 74 -3.8663666248321533, 1.3590080738067627, -3.8641843795776367, 75 7.839725494384766, -6.69080114364624, 0.5456406474113464, 76 5.776711463928223, 7.263273239135742, -7.419948101043701, 77 5.665064334869385, -6.712906837463379, -3.334894895553589, 78 -1.2103675603866577, 7.255547046661377, 8.903468132019043, 79 -4.01986026763916, 7.114678382873535, -0.11212847381830215, 80 -3.688840866088867, 6.135150909423828, -9.895182609558105 81 ], 82 'descriptor': {shape: [24], dataType: 'float32'}, 83 'constant': true 84 } 85 }, 86 'operators': [{ 87 'name': 'elu', 88 'arguments': [{'input': 'eluInput'}], 89 'outputs': 'eluOutput' 90 }], 91 'expectedOutputs': { 92 'eluOutput': { 93 'data': [ 94 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 95 -0.9790657162666321, 1.3590080738067627, -0.9790199995040894, 96 7.839725494384766, -0.9987577199935913, 0.5456406474113464, 97 5.776711463928223, 7.263273239135742, -0.999400794506073, 98 5.665064334869385, -0.9987848997116089, -0.9643816947937012, 99 -0.7019122838973999, 7.255547046661377, 8.903468132019043, 100 -0.982044517993927, 7.114678382873535, -0.10607059299945831, 101 -0.9749990105628967, 6.135150909423828, -0.99994957447052 102 ], 103 'descriptor': {shape: [24], dataType: 'float32'} 104 } 105 } 106 } 107 }, 108 { 109 'name': 'elu float32 1D tensor default options', 110 'graph': { 111 'inputs': { 112 'eluInput': { 113 'data': [ 114 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 115 -3.8663666248321533, 1.3590080738067627, -3.8641843795776367, 116 7.839725494384766, -6.69080114364624, 0.5456406474113464, 117 5.776711463928223, 7.263273239135742, -7.419948101043701, 118 5.665064334869385, -6.712906837463379, -3.334894895553589, 119 -1.2103675603866577, 7.255547046661377, 8.903468132019043, 120 -4.01986026763916, 7.114678382873535, -0.11212847381830215, 121 -3.688840866088867, 6.135150909423828, -9.895182609558105 122 ], 123 'descriptor': {shape: [24], dataType: 'float32'} 124 } 125 }, 126 'operators': [{ 127 'name': 'elu', 128 'arguments': [{'input': 'eluInput'}], 129 'outputs': 'eluOutput' 130 }], 131 'expectedOutputs': { 132 'eluOutput': { 133 'data': [ 134 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 135 -0.9790657162666321, 1.3590080738067627, -0.9790199995040894, 136 7.839725494384766, -0.9987577199935913, 0.5456406474113464, 137 5.776711463928223, 7.263273239135742, -0.999400794506073, 138 5.665064334869385, -0.9987848997116089, -0.9643816947937012, 139 -0.7019122838973999, 7.255547046661377, 8.903468132019043, 140 -0.982044517993927, 7.114678382873535, -0.10607059299945831, 141 -0.9749990105628967, 6.135150909423828, -0.99994957447052 142 ], 143 'descriptor': {shape: [24], dataType: 'float32'} 144 } 145 } 146 } 147 }, 148 { 149 'name': 'elu float32 2D tensor default options', 150 'graph': { 151 'inputs': { 152 'eluInput': { 153 'data': [ 154 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 155 -3.8663666248321533, 1.3590080738067627, -3.8641843795776367, 156 7.839725494384766, -6.69080114364624, 0.5456406474113464, 157 5.776711463928223, 7.263273239135742, -7.419948101043701, 158 5.665064334869385, -6.712906837463379, -3.334894895553589, 159 -1.2103675603866577, 7.255547046661377, 8.903468132019043, 160 -4.01986026763916, 7.114678382873535, -0.11212847381830215, 161 -3.688840866088867, 6.135150909423828, -9.895182609558105 162 ], 163 'descriptor': {shape: [4, 6], dataType: 'float32'} 164 } 165 }, 166 'operators': [{ 167 'name': 'elu', 168 'arguments': [{'input': 'eluInput'}], 169 'outputs': 'eluOutput' 170 }], 171 'expectedOutputs': { 172 'eluOutput': { 173 'data': [ 174 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 175 -0.9790657162666321, 1.3590080738067627, -0.9790199995040894, 176 7.839725494384766, -0.9987577199935913, 0.5456406474113464, 177 5.776711463928223, 7.263273239135742, -0.999400794506073, 178 5.665064334869385, -0.9987848997116089, -0.9643816947937012, 179 -0.7019122838973999, 7.255547046661377, 8.903468132019043, 180 -0.982044517993927, 7.114678382873535, -0.10607059299945831, 181 -0.9749990105628967, 6.135150909423828, -0.99994957447052 182 ], 183 'descriptor': {shape: [4, 6], dataType: 'float32'} 184 } 185 } 186 } 187 }, 188 { 189 'name': 'elu float32 3D tensor default options', 190 'graph': { 191 'inputs': { 192 'eluInput': { 193 'data': [ 194 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 195 -3.8663666248321533, 1.3590080738067627, -3.8641843795776367, 196 7.839725494384766, -6.69080114364624, 0.5456406474113464, 197 5.776711463928223, 7.263273239135742, -7.419948101043701, 198 5.665064334869385, -6.712906837463379, -3.334894895553589, 199 -1.2103675603866577, 7.255547046661377, 8.903468132019043, 200 -4.01986026763916, 7.114678382873535, -0.11212847381830215, 201 -3.688840866088867, 6.135150909423828, -9.895182609558105 202 ], 203 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} 204 } 205 }, 206 'operators': [{ 207 'name': 'elu', 208 'arguments': [{'input': 'eluInput'}], 209 'outputs': 'eluOutput' 210 }], 211 'expectedOutputs': { 212 'eluOutput': { 213 'data': [ 214 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 215 -0.9790657162666321, 1.3590080738067627, -0.9790199995040894, 216 7.839725494384766, -0.9987577199935913, 0.5456406474113464, 217 5.776711463928223, 7.263273239135742, -0.999400794506073, 218 5.665064334869385, -0.9987848997116089, -0.9643816947937012, 219 -0.7019122838973999, 7.255547046661377, 8.903468132019043, 220 -0.982044517993927, 7.114678382873535, -0.10607059299945831, 221 -0.9749990105628967, 6.135150909423828, -0.99994957447052 222 ], 223 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} 224 } 225 } 226 } 227 }, 228 { 229 'name': 'elu float32 4D tensor default options', 230 'graph': { 231 'inputs': { 232 'eluInput': { 233 'data': [ 234 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 235 -3.8663666248321533, 1.3590080738067627, -3.8641843795776367, 236 7.839725494384766, -6.69080114364624, 0.5456406474113464, 237 5.776711463928223, 7.263273239135742, -7.419948101043701, 238 5.665064334869385, -6.712906837463379, -3.334894895553589, 239 -1.2103675603866577, 7.255547046661377, 8.903468132019043, 240 -4.01986026763916, 7.114678382873535, -0.11212847381830215, 241 -3.688840866088867, 6.135150909423828, -9.895182609558105 242 ], 243 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} 244 } 245 }, 246 'operators': [{ 247 'name': 'elu', 248 'arguments': [{'input': 'eluInput'}], 249 'outputs': 'eluOutput' 250 }], 251 'expectedOutputs': { 252 'eluOutput': { 253 'data': [ 254 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 255 -0.9790657162666321, 1.3590080738067627, -0.9790199995040894, 256 7.839725494384766, -0.9987577199935913, 0.5456406474113464, 257 5.776711463928223, 7.263273239135742, -0.999400794506073, 258 5.665064334869385, -0.9987848997116089, -0.9643816947937012, 259 -0.7019122838973999, 7.255547046661377, 8.903468132019043, 260 -0.982044517993927, 7.114678382873535, -0.10607059299945831, 261 -0.9749990105628967, 6.135150909423828, -0.99994957447052 262 ], 263 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} 264 } 265 } 266 } 267 }, 268 { 269 'name': 'elu float32 5D tensor default options', 270 'graph': { 271 'inputs': { 272 'eluInput': { 273 'data': [ 274 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 275 -3.8663666248321533, 1.3590080738067627, -3.8641843795776367, 276 7.839725494384766, -6.69080114364624, 0.5456406474113464, 277 5.776711463928223, 7.263273239135742, -7.419948101043701, 278 5.665064334869385, -6.712906837463379, -3.334894895553589, 279 -1.2103675603866577, 7.255547046661377, 8.903468132019043, 280 -4.01986026763916, 7.114678382873535, -0.11212847381830215, 281 -3.688840866088867, 6.135150909423828, -9.895182609558105 282 ], 283 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} 284 } 285 }, 286 'operators': [{ 287 'name': 'elu', 288 'arguments': [{'input': 'eluInput'}], 289 'outputs': 'eluOutput' 290 }], 291 'expectedOutputs': { 292 'eluOutput': { 293 'data': [ 294 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 295 -0.9790657162666321, 1.3590080738067627, -0.9790199995040894, 296 7.839725494384766, -0.9987577199935913, 0.5456406474113464, 297 5.776711463928223, 7.263273239135742, -0.999400794506073, 298 5.665064334869385, -0.9987848997116089, -0.9643816947937012, 299 -0.7019122838973999, 7.255547046661377, 8.903468132019043, 300 -0.982044517993927, 7.114678382873535, -0.10607059299945831, 301 -0.9749990105628967, 6.135150909423828, -0.99994957447052 302 ], 303 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} 304 } 305 } 306 } 307 }, 308 { 309 'name': 'elu float32 4D tensor positive options.alpha', 310 'graph': { 311 'inputs': { 312 'eluInput': { 313 'data': [ 314 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 315 -3.8663666248321533, 1.3590080738067627, -3.8641843795776367, 316 7.839725494384766, -6.69080114364624, 0.5456406474113464, 317 5.776711463928223, 7.263273239135742, -7.419948101043701, 318 5.665064334869385, -6.712906837463379, -3.334894895553589, 319 -1.2103675603866577, 7.255547046661377, 8.903468132019043, 320 -4.01986026763916, 7.114678382873535, -0.11212847381830215, 321 -3.688840866088867, 6.135150909423828, -9.895182609558105 322 ], 323 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} 324 } 325 }, 326 'operators': [{ 327 'name': 'elu', 328 'arguments': 329 [{'input': 'eluInput'}, {'options': {'alpha': 0.3607245505146506}}], 330 'outputs': 'eluOutput' 331 }], 332 'expectedOutputs': { 333 'eluOutput': { 334 'data': [ 335 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 336 -0.35317301750183105, 1.3590080738067627, -0.35315653681755066, 337 7.839725494384766, -0.36027640104293823, 0.5456406474113464, 338 5.776711463928223, 7.263273239135742, -0.36050841212272644, 339 5.665064334869385, -0.3602862060070038, -0.3478761315345764, 340 -0.25319698452949524, 7.255547046661377, 8.903468132019043, 341 -0.3542475700378418, 7.114678382873535, -0.0382622666656971, 342 -0.3517060875892639, 6.135150909423828, -0.3607063591480255 343 ], 344 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} 345 } 346 } 347 } 348 }, 349 { 350 'name': 'elu float32 4D tensor negative options.alpha', 351 'graph': { 352 'inputs': { 353 'eluInput': { 354 'data': [ 355 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 356 -3.8663666248321533, 1.3590080738067627, -3.8641843795776367, 357 7.839725494384766, -6.69080114364624, 0.5456406474113464, 358 5.776711463928223, 7.263273239135742, -7.419948101043701, 359 5.665064334869385, -6.712906837463379, -3.334894895553589, 360 -1.2103675603866577, 7.255547046661377, 8.903468132019043, 361 -4.01986026763916, 7.114678382873535, -0.11212847381830215, 362 -3.688840866088867, 6.135150909423828, -9.895182609558105 363 ], 364 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} 365 } 366 }, 367 'operators': [{ 368 'name': 'elu', 369 'arguments': 370 [{'input': 'eluInput'}, {'options': {'alpha': -3.468180406374035}}], 371 'outputs': 'eluOutput' 372 }], 373 'expectedOutputs': { 374 'eluOutput': { 375 'data': [ 376 4.721739768981934, 0.3768780529499054, 1.4189997911453247, 377 3.3955764770507812, 1.3590080738067627, 3.3954179286956787, 378 7.839725494384766, 3.463871955871582, 0.5456406474113464, 379 5.776711463928223, 7.263273239135742, 3.466102361679077, 380 5.665064334869385, 3.463966131210327, 3.34464955329895, 381 2.434358596801758, 7.255547046661377, 8.903468132019043, 382 3.40590763092041, 7.114678382873535, 0.3678719699382782, 383 3.381472587585449, 6.135150909423828, 3.468005657196045 384 ], 385 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} 386 } 387 } 388 } 389 }, 390 391 // float16 tests 392 { 393 'name': 'elu float16 positive 0D scalar default options', 394 'graph': { 395 'inputs': { 396 'eluInput': { 397 'data': [4.72265625], 398 'descriptor': {shape: [], dataType: 'float16'} 399 } 400 }, 401 'operators': [{ 402 'name': 'elu', 403 'arguments': [{'input': 'eluInput'}], 404 'outputs': 'eluOutput' 405 }], 406 'expectedOutputs': { 407 'eluOutput': { 408 'data': [4.72265625], 409 'descriptor': {shape: [], dataType: 'float16'} 410 } 411 } 412 } 413 }, 414 { 415 'name': 'elu float16 negative 0D scalar default options', 416 'graph': { 417 'inputs': { 418 'eluInput': { 419 'data': [-3.8671875], 420 'descriptor': {shape: [], dataType: 'float16'} 421 } 422 }, 423 'operators': [{ 424 'name': 'elu', 425 'arguments': [{'input': 'eluInput'}], 426 'outputs': 'eluOutput' 427 }], 428 'expectedOutputs': { 429 'eluOutput': { 430 'data': [-0.97900390625], 431 'descriptor': {shape: [], dataType: 'float16'} 432 } 433 } 434 } 435 }, 436 { 437 'name': 'elu float16 1D constant tensor default options', 438 'graph': { 439 'inputs': { 440 'eluInput': { 441 'data': [ 442 4.72265625, 0.376953125, 1.4189453125, -3.8671875, 443 1.359375, -3.86328125, 7.83984375, -6.69140625, 444 0.54541015625, 5.77734375, 7.26171875, -7.421875, 445 5.6640625, -6.71484375, -3.333984375, -1.2099609375, 446 7.25390625, 8.90625, -4.01953125, 7.11328125, 447 -0.11212158203125, -3.689453125, 6.13671875, -9.8984375 448 ], 449 'descriptor': {shape: [24], dataType: 'float16'}, 450 'constant': true 451 } 452 }, 453 'operators': [{ 454 'name': 'elu', 455 'arguments': [{'input': 'eluInput'}], 456 'outputs': 'eluOutput' 457 }], 458 'expectedOutputs': { 459 'eluOutput': { 460 'data': [ 461 4.72265625, 0.376953125, 1.4189453125, -0.97900390625, 462 1.359375, -0.97900390625, 7.83984375, -0.99853515625, 463 0.54541015625, 5.77734375, 7.26171875, -0.99951171875, 464 5.6640625, -0.9990234375, -0.96435546875, -0.70166015625, 465 7.25390625, 8.90625, -0.98193359375, 7.11328125, 466 -0.1060791015625, -0.97509765625, 6.13671875, -1 467 ], 468 'descriptor': {shape: [24], dataType: 'float16'} 469 } 470 } 471 } 472 }, 473 { 474 'name': 'elu float16 1D tensor default options', 475 'graph': { 476 'inputs': { 477 'eluInput': { 478 'data': [ 479 4.72265625, 0.376953125, 1.4189453125, -3.8671875, 480 1.359375, -3.86328125, 7.83984375, -6.69140625, 481 0.54541015625, 5.77734375, 7.26171875, -7.421875, 482 5.6640625, -6.71484375, -3.333984375, -1.2099609375, 483 7.25390625, 8.90625, -4.01953125, 7.11328125, 484 -0.11212158203125, -3.689453125, 6.13671875, -9.8984375 485 ], 486 'descriptor': {shape: [24], dataType: 'float16'} 487 } 488 }, 489 'operators': [{ 490 'name': 'elu', 491 'arguments': [{'input': 'eluInput'}], 492 'outputs': 'eluOutput' 493 }], 494 'expectedOutputs': { 495 'eluOutput': { 496 'data': [ 497 4.72265625, 0.376953125, 1.4189453125, -0.97900390625, 498 1.359375, -0.97900390625, 7.83984375, -0.99853515625, 499 0.54541015625, 5.77734375, 7.26171875, -0.99951171875, 500 5.6640625, -0.9990234375, -0.96435546875, -0.70166015625, 501 7.25390625, 8.90625, -0.98193359375, 7.11328125, 502 -0.1060791015625, -0.97509765625, 6.13671875, -1 503 ], 504 'descriptor': {shape: [24], dataType: 'float16'} 505 } 506 } 507 } 508 }, 509 { 510 'name': 'elu float16 2D tensor default options', 511 'graph': { 512 'inputs': { 513 'eluInput': { 514 'data': [ 515 4.72265625, 0.376953125, 1.4189453125, -3.8671875, 516 1.359375, -3.86328125, 7.83984375, -6.69140625, 517 0.54541015625, 5.77734375, 7.26171875, -7.421875, 518 5.6640625, -6.71484375, -3.333984375, -1.2099609375, 519 7.25390625, 8.90625, -4.01953125, 7.11328125, 520 -0.11212158203125, -3.689453125, 6.13671875, -9.8984375 521 ], 522 'descriptor': {shape: [4, 6], dataType: 'float16'} 523 } 524 }, 525 'operators': [{ 526 'name': 'elu', 527 'arguments': [{'input': 'eluInput'}], 528 'outputs': 'eluOutput' 529 }], 530 'expectedOutputs': { 531 'eluOutput': { 532 'data': [ 533 4.72265625, 0.376953125, 1.4189453125, -0.97900390625, 534 1.359375, -0.97900390625, 7.83984375, -0.99853515625, 535 0.54541015625, 5.77734375, 7.26171875, -0.99951171875, 536 5.6640625, -0.9990234375, -0.96435546875, -0.70166015625, 537 7.25390625, 8.90625, -0.98193359375, 7.11328125, 538 -0.1060791015625, -0.97509765625, 6.13671875, -1 539 ], 540 'descriptor': {shape: [4, 6], dataType: 'float16'} 541 } 542 } 543 } 544 }, 545 { 546 'name': 'elu float16 3D tensor default options', 547 'graph': { 548 'inputs': { 549 'eluInput': { 550 'data': [ 551 4.72265625, 0.376953125, 1.4189453125, -3.8671875, 552 1.359375, -3.86328125, 7.83984375, -6.69140625, 553 0.54541015625, 5.77734375, 7.26171875, -7.421875, 554 5.6640625, -6.71484375, -3.333984375, -1.2099609375, 555 7.25390625, 8.90625, -4.01953125, 7.11328125, 556 -0.11212158203125, -3.689453125, 6.13671875, -9.8984375 557 ], 558 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} 559 } 560 }, 561 'operators': [{ 562 'name': 'elu', 563 'arguments': [{'input': 'eluInput'}], 564 'outputs': 'eluOutput' 565 }], 566 'expectedOutputs': { 567 'eluOutput': { 568 'data': [ 569 4.72265625, 0.376953125, 1.4189453125, -0.97900390625, 570 1.359375, -0.97900390625, 7.83984375, -0.99853515625, 571 0.54541015625, 5.77734375, 7.26171875, -0.99951171875, 572 5.6640625, -0.9990234375, -0.96435546875, -0.70166015625, 573 7.25390625, 8.90625, -0.98193359375, 7.11328125, 574 -0.1060791015625, -0.97509765625, 6.13671875, -1 575 ], 576 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} 577 } 578 } 579 } 580 }, 581 { 582 'name': 'elu float16 4D tensor default options', 583 'graph': { 584 'inputs': { 585 'eluInput': { 586 'data': [ 587 4.72265625, 0.376953125, 1.4189453125, -3.8671875, 588 1.359375, -3.86328125, 7.83984375, -6.69140625, 589 0.54541015625, 5.77734375, 7.26171875, -7.421875, 590 5.6640625, -6.71484375, -3.333984375, -1.2099609375, 591 7.25390625, 8.90625, -4.01953125, 7.11328125, 592 -0.11212158203125, -3.689453125, 6.13671875, -9.8984375 593 ], 594 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float16'} 595 } 596 }, 597 'operators': [{ 598 'name': 'elu', 599 'arguments': [{'input': 'eluInput'}], 600 'outputs': 'eluOutput' 601 }], 602 'expectedOutputs': { 603 'eluOutput': { 604 'data': [ 605 4.72265625, 0.376953125, 1.4189453125, -0.97900390625, 606 1.359375, -0.97900390625, 7.83984375, -0.99853515625, 607 0.54541015625, 5.77734375, 7.26171875, -0.99951171875, 608 5.6640625, -0.9990234375, -0.96435546875, -0.70166015625, 609 7.25390625, 8.90625, -0.98193359375, 7.11328125, 610 -0.1060791015625, -0.97509765625, 6.13671875, -1 611 ], 612 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float16'} 613 } 614 } 615 } 616 }, 617 { 618 'name': 'elu float16 5D tensor default options', 619 'graph': { 620 'inputs': { 621 'eluInput': { 622 'data': [ 623 4.72265625, 0.376953125, 1.4189453125, -3.8671875, 624 1.359375, -3.86328125, 7.83984375, -6.69140625, 625 0.54541015625, 5.77734375, 7.26171875, -7.421875, 626 5.6640625, -6.71484375, -3.333984375, -1.2099609375, 627 7.25390625, 8.90625, -4.01953125, 7.11328125, 628 -0.11212158203125, -3.689453125, 6.13671875, -9.8984375 629 ], 630 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float16'} 631 } 632 }, 633 'operators': [{ 634 'name': 'elu', 635 'arguments': [{'input': 'eluInput'}], 636 'outputs': 'eluOutput' 637 }], 638 'expectedOutputs': { 639 'eluOutput': { 640 'data': [ 641 4.72265625, 0.376953125, 1.4189453125, -0.97900390625, 642 1.359375, -0.97900390625, 7.83984375, -0.99853515625, 643 0.54541015625, 5.77734375, 7.26171875, -0.99951171875, 644 5.6640625, -0.9990234375, -0.96435546875, -0.70166015625, 645 7.25390625, 8.90625, -0.98193359375, 7.11328125, 646 -0.1060791015625, -0.97509765625, 6.13671875, -1 647 ], 648 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float16'} 649 } 650 } 651 } 652 }, 653 { 654 'name': 'elu float16 4D tensor positive options.alpha', 655 'graph': { 656 'inputs': { 657 'eluInput': { 658 'data': [ 659 4.72265625, 0.376953125, 1.4189453125, -3.8671875, 660 1.359375, -3.86328125, 7.83984375, -6.69140625, 661 0.54541015625, 5.77734375, 7.26171875, -7.421875, 662 5.6640625, -6.71484375, -3.333984375, -1.2099609375, 663 7.25390625, 8.90625, -4.01953125, 7.11328125, 664 -0.11212158203125, -3.689453125, 6.13671875, -9.8984375 665 ], 666 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float16'} 667 } 668 }, 669 'operators': [{ 670 'name': 'elu', 671 'arguments': 672 [{'input': 'eluInput'}, {'options': {'alpha': 0.3607245505146506}}], 673 'outputs': 'eluOutput' 674 }], 675 'expectedOutputs': { 676 'eluOutput': { 677 'data': [ 678 4.72265625, 0.376953125, 1.4189453125, 679 -0.353271484375, 1.359375, -0.353271484375, 680 7.83984375, -0.3603515625, 0.54541015625, 681 5.77734375, 7.26171875, -0.360595703125, 682 5.6640625, -0.3603515625, -0.347900390625, 683 -0.253173828125, 7.25390625, 8.90625, 684 -0.354248046875, 7.11328125, -0.03826904296875, 685 -0.351806640625, 6.13671875, -0.360595703125 686 ], 687 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float16'} 688 } 689 } 690 } 691 }, 692 { 693 'name': 'elu float16 4D tensor negative options.alpha', 694 'graph': { 695 'inputs': { 696 'eluInput': { 697 'data': [ 698 4.72265625, 0.376953125, 1.4189453125, -3.8671875, 699 1.359375, -3.86328125, 7.83984375, -6.69140625, 700 0.54541015625, 5.77734375, 7.26171875, -7.421875, 701 5.6640625, -6.71484375, -3.333984375, -1.2099609375, 702 7.25390625, 8.90625, -4.01953125, 7.11328125, 703 -0.11212158203125, -3.689453125, 6.13671875, -9.8984375 704 ], 705 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float16'} 706 } 707 }, 708 'operators': [{ 709 'name': 'elu', 710 'arguments': 711 [{'input': 'eluInput'}, {'options': {'alpha': -3.468180406374035}}], 712 'outputs': 'eluOutput' 713 }], 714 'expectedOutputs': { 715 'eluOutput': { 716 'data': [ 717 4.72265625, 0.376953125, 1.4189453125, 3.396484375, 718 1.359375, 3.39453125, 7.83984375, 3.46484375, 719 0.54541015625, 5.77734375, 7.26171875, 3.466796875, 720 5.6640625, 3.46484375, 3.34375, 2.43359375, 721 7.25390625, 8.90625, 3.40625, 7.11328125, 722 0.367919921875, 3.380859375, 6.13671875, 3.46875 723 ], 724 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float16'} 725 } 726 } 727 } 728 } 729 ]; 730 731 webnn_conformance_test(eluTests, buildAndExecuteGraph, getPrecisionTolerance);