l2Pool2d.https.any.js (55823B)
1 // META: title=test WebNN API l2Pool2d 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-pool2d 12 // Compute a pooling operation across all the elements within the moving window 13 // over the input tensor. 14 // 15 // enum MLRoundingType { 16 // "floor", 17 // "ceil" 18 // }; 19 // 20 // dictionary MLPool2dOptions { 21 // sequence<[EnforceRange] unsigned long> windowDimensions; 22 // sequence<[EnforceRange] unsigned long> padding; 23 // sequence<[EnforceRange] unsigned long> strides; 24 // sequence<[EnforceRange] unsigned long> dilations; 25 // MLInputOperandLayout layout = "nchw"; 26 // MLRoundingType roundingType = "floor"; 27 // sequence<[EnforceRange] unsigned long> outputSizes; 28 // }; 29 // 30 // MLOperand l2Pool2d( 31 // MLOperand input, optional MLPool2dOptions options = {}); 32 33 const l2Pool2dTests = [ 34 // float32 tests 35 { 36 'name': 'l2Pool2d float32 4D constant tensor all positive default options', 37 'graph': { 38 'inputs': { 39 'l2Pool2dInput': { 40 'data': [ 41 94.07447814941406, 76.55464172363281, 62.71847152709961, 42 83.8726577758789, 73.10235595703125, 41.52470779418945, 43 39.3339729309082, 86.59486389160156, 23.09039306640625, 44 53.650146484375, 0.00902052316814661, 42.78899383544922, 45 81.03960418701172, 33.48585510253906, 33.67196273803711, 46 0.42822372913360596, 80.07991790771484, 5.929991722106934, 47 48.89164733886719, 15.282920837402344, 13.335721969604492, 48 39.06557846069336, 97.06050109863281, 83.68133544921875, 49 21.79571533203125, 52.027313232421875, 6.397815227508545, 50 84.54785919189453, 18.622516632080078, 34.10626220703125, 51 73.96932220458984, 36.1437873840332, 60.73781967163086, 52 55.09187316894531, 63.8924446105957, 59.36124038696289, 53 50.91202926635742, 50.339813232421875, 59.31963348388672, 54 70.78031921386719, 35.56179428100586, 82.53382873535156, 55 7.572360038757324, 61.90089416503906, 14.084012985229492, 56 90.86540985107422, 39.56248474121094, 67.77167510986328, 57 69.69512176513672, 89.54518127441406 58 ], 59 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'}, 60 'constant': true 61 } 62 }, 63 'operators': [{ 64 'name': 'l2Pool2d', 65 'arguments': [{'input': 'l2Pool2dInput'}], 66 'outputs': 'l2Pool2dOutput' 67 }], 68 'expectedOutputs': { 69 'l2Pool2dOutput': { 70 'data': [289.01953125, 292.6146545410156], 71 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} 72 } 73 } 74 } 75 }, 76 { 77 'name': 'l2Pool2d float32 4D tensor all positive default options', 78 'graph': { 79 'inputs': { 80 'l2Pool2dInput': { 81 'data': [ 82 94.07447814941406, 76.55464172363281, 62.71847152709961, 83 83.8726577758789, 73.10235595703125, 41.52470779418945, 84 39.3339729309082, 86.59486389160156, 23.09039306640625, 85 53.650146484375, 0.00902052316814661, 42.78899383544922, 86 81.03960418701172, 33.48585510253906, 33.67196273803711, 87 0.42822372913360596, 80.07991790771484, 5.929991722106934, 88 48.89164733886719, 15.282920837402344, 13.335721969604492, 89 39.06557846069336, 97.06050109863281, 83.68133544921875, 90 21.79571533203125, 52.027313232421875, 6.397815227508545, 91 84.54785919189453, 18.622516632080078, 34.10626220703125, 92 73.96932220458984, 36.1437873840332, 60.73781967163086, 93 55.09187316894531, 63.8924446105957, 59.36124038696289, 94 50.91202926635742, 50.339813232421875, 59.31963348388672, 95 70.78031921386719, 35.56179428100586, 82.53382873535156, 96 7.572360038757324, 61.90089416503906, 14.084012985229492, 97 90.86540985107422, 39.56248474121094, 67.77167510986328, 98 69.69512176513672, 89.54518127441406 99 ], 100 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 101 } 102 }, 103 'operators': [{ 104 'name': 'l2Pool2d', 105 'arguments': [{'input': 'l2Pool2dInput'}], 106 'outputs': 'l2Pool2dOutput' 107 }], 108 'expectedOutputs': { 109 'l2Pool2dOutput': { 110 'data': [289.01953125, 292.6146545410156], 111 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} 112 } 113 } 114 } 115 }, 116 { 117 'name': 'l2Pool2d float32 4D tensor all negative default options', 118 'graph': { 119 'inputs': { 120 'l2Pool2dInput': { 121 'data': [ 122 -1.1957088708877563, -9.706199645996094, -39.54935836791992, 123 -82.34971618652344, -32.87415313720703, -50.22603225708008, 124 -31.17849349975586, -55.817893981933594, -46.70829391479492, 125 -38.68181228637695, -63.299320220947266, -35.09224319458008, 126 -80.93848419189453, -82.8619613647461, -40.41627502441406, 127 -34.86458206176758, -84.33639526367188, -84.11852264404297, 128 -5.525088787078857, -99.03114318847656, -75.505126953125, 129 -91.43389129638672, -96.71258544921875, -16.722585678100586, 130 -17.98292350769043, -58.06570816040039, -11.846800804138184, 131 -97.90313720703125, -38.69822692871094, -80.19510650634766, 132 -48.72047805786133, -90.86722564697266, -99.10758209228516, 133 -79.70288848876953, -59.3824462890625, -9.967330932617188, 134 -39.27534866333008, -10.469644546508789, -27.565326690673828, 135 -2.0468990802764893, -81.88761901855469, -66.88040161132812, 136 -85.98504638671875, -29.674592971801758, -19.649417877197266, 137 -89.39192199707031, -61.13504409790039, -84.16869354248047, 138 -77.36112213134766, -91.17266082763672 139 ], 140 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 141 } 142 }, 143 'operators': [{ 144 'name': 'l2Pool2d', 145 'arguments': [{'input': 'l2Pool2dInput'}], 146 'outputs': 'l2Pool2dOutput' 147 }], 148 'expectedOutputs': { 149 'l2Pool2dOutput': { 150 'data': [298.928955078125, 326.83587646484375], 151 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} 152 } 153 } 154 } 155 }, 156 { 157 'name': 'l2Pool2d float32 4D tensor options.windowDimensions', 158 'graph': { 159 'inputs': { 160 'l2Pool2dInput': { 161 'data': [ 162 94.07447814941406, 76.55464172363281, 62.71847152709961, 163 83.8726577758789, 73.10235595703125, 41.52470779418945, 164 39.3339729309082, 86.59486389160156, 23.09039306640625, 165 53.650146484375, 0.00902052316814661, 42.78899383544922, 166 81.03960418701172, 33.48585510253906, 33.67196273803711, 167 0.42822372913360596, 80.07991790771484, 5.929991722106934, 168 48.89164733886719, 15.282920837402344, 13.335721969604492, 169 39.06557846069336, 97.06050109863281, 83.68133544921875, 170 21.79571533203125, 52.027313232421875, 6.397815227508545, 171 84.54785919189453, 18.622516632080078, 34.10626220703125, 172 73.96932220458984, 36.1437873840332, 60.73781967163086, 173 55.09187316894531, 63.8924446105957, 59.36124038696289, 174 50.91202926635742, 50.339813232421875, 59.31963348388672, 175 70.78031921386719, 35.56179428100586, 82.53382873535156, 176 7.572360038757324, 61.90089416503906, 14.084012985229492, 177 90.86540985107422, 39.56248474121094, 67.77167510986328, 178 69.69512176513672, 89.54518127441406 179 ], 180 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 181 } 182 }, 183 'operators': [{ 184 'name': 'l2Pool2d', 185 'arguments': [ 186 {'input': 'l2Pool2dInput'}, {'options': {'windowDimensions': [3, 3]}} 187 ], 188 'outputs': 'l2Pool2dOutput' 189 }], 190 'expectedOutputs': { 191 'l2Pool2dOutput': { 192 'data': [ 193 194.45481872558594, 189.54539489746094, 189.85488891601562, 194 160.0518341064453, 167.1435546875, 149.63897705078125, 195 161.15570068359375, 190.5449981689453, 168.4636688232422, 196 170.331787109375, 155.60073852539062, 174.72145080566406, 197 165.07762145996094, 165.45819091796875, 161.11062622070312, 198 176.6307373046875, 174.245361328125, 180.60714721679688 199 ], 200 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} 201 } 202 } 203 } 204 }, 205 { 206 'name': 'l2Pool2d float32 4D tensor options.padding', 207 'graph': { 208 'inputs': { 209 'l2Pool2dInput': { 210 'data': [ 211 94.07447814941406, 76.55464172363281, 62.71847152709961, 212 83.8726577758789, 73.10235595703125, 41.52470779418945, 213 39.3339729309082, 86.59486389160156, 23.09039306640625, 214 53.650146484375, 0.00902052316814661, 42.78899383544922, 215 81.03960418701172, 33.48585510253906, 33.67196273803711, 216 0.42822372913360596, 80.07991790771484, 5.929991722106934, 217 48.89164733886719, 15.282920837402344, 13.335721969604492, 218 39.06557846069336, 97.06050109863281, 83.68133544921875, 219 21.79571533203125, 52.027313232421875, 6.397815227508545, 220 84.54785919189453, 18.622516632080078, 34.10626220703125, 221 73.96932220458984, 36.1437873840332, 60.73781967163086, 222 55.09187316894531, 63.8924446105957, 59.36124038696289, 223 50.91202926635742, 50.339813232421875, 59.31963348388672, 224 70.78031921386719, 35.56179428100586, 82.53382873535156, 225 7.572360038757324, 61.90089416503906, 14.084012985229492, 226 90.86540985107422, 39.56248474121094, 67.77167510986328, 227 69.69512176513672, 89.54518127441406 228 ], 229 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 230 } 231 }, 232 'operators': [{ 233 'name': 'l2Pool2d', 234 'arguments': [ 235 {'input': 'l2Pool2dInput'}, {'options': {'padding': [1, 0, 0, 1]}} 236 ], 237 'outputs': 'l2Pool2dOutput' 238 }], 239 'expectedOutputs': { 240 'l2Pool2dOutput': { 241 'data': [ 242 254.81358337402344, 233.14259338378906, 289.01953125, 243 269.777587890625, 241.52200317382812, 212.99337768554688, 244 292.6146545410156, 253.77178955078125 245 ], 246 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} 247 } 248 } 249 } 250 }, 251 { 252 'name': 'l2Pool2d float32 4D tensor options.strides', 253 'graph': { 254 'inputs': { 255 'l2Pool2dInput': { 256 'data': [ 257 94.07447814941406, 76.55464172363281, 62.71847152709961, 258 83.8726577758789, 73.10235595703125, 41.52470779418945, 259 39.3339729309082, 86.59486389160156, 23.09039306640625, 260 53.650146484375, 0.00902052316814661, 42.78899383544922, 261 81.03960418701172, 33.48585510253906, 33.67196273803711, 262 0.42822372913360596, 80.07991790771484, 5.929991722106934, 263 48.89164733886719, 15.282920837402344, 13.335721969604492, 264 39.06557846069336, 97.06050109863281, 83.68133544921875, 265 21.79571533203125, 52.027313232421875, 6.397815227508545, 266 84.54785919189453, 18.622516632080078, 34.10626220703125, 267 73.96932220458984, 36.1437873840332, 60.73781967163086, 268 55.09187316894531, 63.8924446105957, 59.36124038696289, 269 50.91202926635742, 50.339813232421875, 59.31963348388672, 270 70.78031921386719, 35.56179428100586, 82.53382873535156, 271 7.572360038757324, 61.90089416503906, 14.084012985229492, 272 90.86540985107422, 39.56248474121094, 67.77167510986328, 273 69.69512176513672, 89.54518127441406 274 ], 275 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 276 } 277 }, 278 'operators': [{ 279 'name': 'l2Pool2d', 280 'arguments': [ 281 {'input': 'l2Pool2dInput'}, 282 {'options': {'windowDimensions': [3, 3], 'strides': [2, 2]}} 283 ], 284 'outputs': 'l2Pool2dOutput' 285 }], 286 'expectedOutputs': { 287 'l2Pool2dOutput': { 288 'data': [ 289 194.45481872558594, 189.85488891601562, 161.15570068359375, 290 168.4636688232422, 170.331787109375, 174.72145080566406, 291 176.6307373046875, 180.60714721679688 292 ], 293 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} 294 } 295 } 296 } 297 }, 298 { 299 'name': 'l2Pool2d float32 4D tensor options.dilations', 300 'graph': { 301 'inputs': { 302 'l2Pool2dInput': { 303 'data': [ 304 94.07447814941406, 76.55464172363281, 62.71847152709961, 305 83.8726577758789, 73.10235595703125, 41.52470779418945, 306 39.3339729309082, 86.59486389160156, 23.09039306640625, 307 53.650146484375, 0.00902052316814661, 42.78899383544922, 308 81.03960418701172, 33.48585510253906, 33.67196273803711, 309 0.42822372913360596, 80.07991790771484, 5.929991722106934, 310 48.89164733886719, 15.282920837402344, 13.335721969604492, 311 39.06557846069336, 97.06050109863281, 83.68133544921875, 312 21.79571533203125, 52.027313232421875, 6.397815227508545, 313 84.54785919189453, 18.622516632080078, 34.10626220703125, 314 73.96932220458984, 36.1437873840332, 60.73781967163086, 315 55.09187316894531, 63.8924446105957, 59.36124038696289, 316 50.91202926635742, 50.339813232421875, 59.31963348388672, 317 70.78031921386719, 35.56179428100586, 82.53382873535156, 318 7.572360038757324, 61.90089416503906, 14.084012985229492, 319 90.86540985107422, 39.56248474121094, 67.77167510986328, 320 69.69512176513672, 89.54518127441406 321 ], 322 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 323 } 324 }, 325 'operators': [{ 326 'name': 'l2Pool2d', 327 'arguments': [ 328 {'input': 'l2Pool2dInput'}, 329 {'options': {'windowDimensions': [3, 3], 'dilations': [2, 2]}} 330 ], 331 'outputs': 'l2Pool2dOutput' 332 }], 333 'expectedOutputs': { 334 'l2Pool2dOutput': { 335 'data': [189.47933959960938, 207.25343322753906], 336 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} 337 } 338 } 339 } 340 }, 341 { 342 'name': 'l2Pool2d float32 4D tensor options.layout=nchw', 343 'graph': { 344 'inputs': { 345 'l2Pool2dInput': { 346 'data': [ 347 94.07447814941406, 76.55464172363281, 62.71847152709961, 348 83.8726577758789, 73.10235595703125, 41.52470779418945, 349 39.3339729309082, 86.59486389160156, 23.09039306640625, 350 53.650146484375, 0.00902052316814661, 42.78899383544922, 351 81.03960418701172, 33.48585510253906, 33.67196273803711, 352 0.42822372913360596, 80.07991790771484, 5.929991722106934, 353 48.89164733886719, 15.282920837402344, 13.335721969604492, 354 39.06557846069336, 97.06050109863281, 83.68133544921875, 355 21.79571533203125, 52.027313232421875, 6.397815227508545, 356 84.54785919189453, 18.622516632080078, 34.10626220703125, 357 73.96932220458984, 36.1437873840332, 60.73781967163086, 358 55.09187316894531, 63.8924446105957, 59.36124038696289, 359 50.91202926635742, 50.339813232421875, 59.31963348388672, 360 70.78031921386719, 35.56179428100586, 82.53382873535156, 361 7.572360038757324, 61.90089416503906, 14.084012985229492, 362 90.86540985107422, 39.56248474121094, 67.77167510986328, 363 69.69512176513672, 89.54518127441406 364 ], 365 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 366 } 367 }, 368 'operators': [{ 369 'name': 'l2Pool2d', 370 'arguments': 371 [{'input': 'l2Pool2dInput'}, {'options': {'layout': 'nchw'}}], 372 'outputs': 'l2Pool2dOutput' 373 }], 374 'expectedOutputs': { 375 'l2Pool2dOutput': { 376 'data': [289.01953125, 292.6146545410156], 377 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} 378 } 379 } 380 } 381 }, 382 { 383 'name': 'l2Pool2d float32 4D tensor options.layout=nhwc', 384 'graph': { 385 'inputs': { 386 'l2Pool2dInput': { 387 'data': [ 388 94.07447814941406, 52.027313232421875, 76.55464172363281, 389 6.397815227508545, 62.71847152709961, 84.54785919189453, 390 83.8726577758789, 18.622516632080078, 73.10235595703125, 391 34.10626220703125, 41.52470779418945, 73.96932220458984, 392 39.3339729309082, 36.1437873840332, 86.59486389160156, 393 60.73781967163086, 23.09039306640625, 55.09187316894531, 394 53.650146484375, 63.8924446105957, 0.00902052316814661, 395 59.36124038696289, 42.78899383544922, 50.91202926635742, 396 81.03960418701172, 50.339813232421875, 33.48585510253906, 397 59.31963348388672, 33.67196273803711, 70.78031921386719, 398 0.42822372913360596, 35.56179428100586, 80.07991790771484, 399 82.53382873535156, 5.929991722106934, 7.572360038757324, 400 48.89164733886719, 61.90089416503906, 15.282920837402344, 401 14.084012985229492, 13.335721969604492, 90.86540985107422, 402 39.06557846069336, 39.56248474121094, 97.06050109863281, 403 67.77167510986328, 83.68133544921875, 69.69512176513672, 404 21.79571533203125, 89.54518127441406 405 ], 406 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float32'} 407 } 408 }, 409 'operators': [{ 410 'name': 'l2Pool2d', 411 'arguments': 412 [{'input': 'l2Pool2dInput'}, {'options': {'layout': 'nhwc'}}], 413 'outputs': 'l2Pool2dOutput' 414 }], 415 'expectedOutputs': { 416 'l2Pool2dOutput': { 417 'data': [289.01953125, 292.6146545410156], 418 'descriptor': {shape: [1, 1, 1, 2], dataType: 'float32'} 419 } 420 } 421 } 422 }, 423 { 424 'name': 'l2Pool2d float32 4D tensor options.roundingType=floor', 425 'graph': { 426 'inputs': { 427 'l2Pool2dInput': { 428 'data': [ 429 94.07447814941406, 76.55464172363281, 62.71847152709961, 430 83.8726577758789, 73.10235595703125, 41.52470779418945, 431 39.3339729309082, 86.59486389160156, 23.09039306640625, 432 53.650146484375, 0.00902052316814661, 42.78899383544922, 433 81.03960418701172, 33.48585510253906, 33.67196273803711, 434 0.42822372913360596, 80.07991790771484, 5.929991722106934, 435 48.89164733886719, 15.282920837402344, 13.335721969604492, 436 39.06557846069336, 97.06050109863281, 83.68133544921875, 437 21.79571533203125, 52.027313232421875, 6.397815227508545, 438 84.54785919189453, 18.622516632080078, 34.10626220703125, 439 73.96932220458984, 36.1437873840332, 60.73781967163086, 440 55.09187316894531, 63.8924446105957, 59.36124038696289, 441 50.91202926635742, 50.339813232421875, 59.31963348388672, 442 70.78031921386719, 35.56179428100586, 82.53382873535156, 443 7.572360038757324, 61.90089416503906, 14.084012985229492, 444 90.86540985107422, 39.56248474121094, 67.77167510986328, 445 69.69512176513672, 89.54518127441406 446 ], 447 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 448 } 449 }, 450 'operators': [{ 451 'name': 'l2Pool2d', 452 'arguments': [ 453 {'input': 'l2Pool2dInput'}, { 454 'options': { 455 'windowDimensions': [3, 3], 456 'padding': [1, 0, 0, 1], 457 'strides': [2, 2], 458 'roundingType': 'floor' 459 } 460 } 461 ], 462 'outputs': 'l2Pool2dOutput' 463 }], 464 'expectedOutputs': { 465 'l2Pool2dOutput': { 466 'data': [ 467 171.5061492919922, 164.9919891357422, 160.0518341064453, 468 149.63897705078125, 142.6990966796875, 139.51637268066406, 469 165.07762145996094, 161.11062622070312 470 ], 471 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} 472 } 473 } 474 } 475 }, 476 { 477 'name': 'l2Pool2d float32 4D tensor options.roundingType=ceil', 478 'graph': { 479 'inputs': { 480 'l2Pool2dInput': { 481 'data': [ 482 94.07447814941406, 76.55464172363281, 62.71847152709961, 483 83.8726577758789, 73.10235595703125, 41.52470779418945, 484 39.3339729309082, 86.59486389160156, 23.09039306640625, 485 53.650146484375, 0.00902052316814661, 42.78899383544922, 486 81.03960418701172, 33.48585510253906, 33.67196273803711, 487 0.42822372913360596, 80.07991790771484, 5.929991722106934, 488 48.89164733886719, 15.282920837402344, 13.335721969604492, 489 39.06557846069336, 97.06050109863281, 83.68133544921875, 490 21.79571533203125, 52.027313232421875, 6.397815227508545, 491 84.54785919189453, 18.622516632080078, 34.10626220703125, 492 73.96932220458984, 36.1437873840332, 60.73781967163086, 493 55.09187316894531, 63.8924446105957, 59.36124038696289, 494 50.91202926635742, 50.339813232421875, 59.31963348388672, 495 70.78031921386719, 35.56179428100586, 82.53382873535156, 496 7.572360038757324, 61.90089416503906, 14.084012985229492, 497 90.86540985107422, 39.56248474121094, 67.77167510986328, 498 69.69512176513672, 89.54518127441406 499 ], 500 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 501 } 502 }, 503 'operators': [{ 504 'name': 'l2Pool2d', 505 'arguments': [ 506 {'input': 'l2Pool2dInput'}, { 507 'options': { 508 'windowDimensions': [3, 3], 509 'padding': [1, 0, 0, 1], 510 'strides': [2, 2], 511 'roundingType': 'ceil' 512 } 513 } 514 ], 515 'outputs': 'l2Pool2dOutput' 516 }], 517 'expectedOutputs': { 518 'l2Pool2dOutput': { 519 'data': [ 520 171.5061492919922, 164.9919891357422, 90.6768569946289, 521 160.0518341064453, 149.63897705078125, 65.15908813476562, 522 132.56260681152344, 139.84808349609375, 26.61993408203125, 523 142.6990966796875, 139.51637268066406, 72.42569732666016, 524 165.07762145996094, 161.11062622070312, 96.38701629638672, 525 150.1616668701172, 146.8201904296875, 90.64601135253906 526 ], 527 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} 528 } 529 } 530 } 531 }, 532 { 533 'name': 534 'l2Pool2d float32 4D tensor options.outputSizes ignores options.roundingType=floor', 535 'graph': { 536 'inputs': { 537 'l2Pool2dInput': { 538 'data': [ 539 94.07447814941406, 76.55464172363281, 62.71847152709961, 540 83.8726577758789, 73.10235595703125, 41.52470779418945, 541 39.3339729309082, 86.59486389160156, 23.09039306640625, 542 53.650146484375, 0.00902052316814661, 42.78899383544922, 543 81.03960418701172, 33.48585510253906, 33.67196273803711, 544 0.42822372913360596, 80.07991790771484, 5.929991722106934, 545 48.89164733886719, 15.282920837402344, 13.335721969604492, 546 39.06557846069336, 97.06050109863281, 83.68133544921875, 547 21.79571533203125, 52.027313232421875, 6.397815227508545, 548 84.54785919189453, 18.622516632080078, 34.10626220703125, 549 73.96932220458984, 36.1437873840332, 60.73781967163086, 550 55.09187316894531, 63.8924446105957, 59.36124038696289, 551 50.91202926635742, 50.339813232421875, 59.31963348388672, 552 70.78031921386719, 35.56179428100586, 82.53382873535156, 553 7.572360038757324, 61.90089416503906, 14.084012985229492, 554 90.86540985107422, 39.56248474121094, 67.77167510986328, 555 69.69512176513672, 89.54518127441406 556 ], 557 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 558 } 559 }, 560 'operators': [{ 561 'name': 'l2Pool2d', 562 'arguments': [ 563 {'input': 'l2Pool2dInput'}, { 564 'options': { 565 'windowDimensions': [3, 3], 566 'padding': [1, 0, 0, 1], 567 'strides': [2, 2], 568 'roundingType': 'floor', 569 'outputSizes': [3, 3] 570 } 571 } 572 ], 573 'outputs': 'l2Pool2dOutput' 574 }], 575 'expectedOutputs': { 576 'l2Pool2dOutput': { 577 'data': [ 578 171.5061492919922, 164.9919891357422, 90.6768569946289, 579 160.0518341064453, 149.63897705078125, 65.15908813476562, 580 132.56260681152344, 139.84808349609375, 26.61993408203125, 581 142.6990966796875, 139.51637268066406, 72.42569732666016, 582 165.07762145996094, 161.11062622070312, 96.38701629638672, 583 150.1616668701172, 146.8201904296875, 90.64601135253906 584 ], 585 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} 586 } 587 } 588 } 589 }, 590 { 591 'name': 592 'l2Pool2d float32 4D tensor options.outputSizes ignores options.roundingType=ceil', 593 'graph': { 594 'inputs': { 595 'l2Pool2dInput': { 596 'data': [ 597 94.07447814941406, 76.55464172363281, 62.71847152709961, 598 83.8726577758789, 73.10235595703125, 41.52470779418945, 599 39.3339729309082, 86.59486389160156, 23.09039306640625, 600 53.650146484375, 0.00902052316814661, 42.78899383544922, 601 81.03960418701172, 33.48585510253906, 33.67196273803711, 602 0.42822372913360596, 80.07991790771484, 5.929991722106934, 603 48.89164733886719, 15.282920837402344, 13.335721969604492, 604 39.06557846069336, 97.06050109863281, 83.68133544921875, 605 21.79571533203125, 52.027313232421875, 6.397815227508545, 606 84.54785919189453, 18.622516632080078, 34.10626220703125, 607 73.96932220458984, 36.1437873840332, 60.73781967163086, 608 55.09187316894531, 63.8924446105957, 59.36124038696289, 609 50.91202926635742, 50.339813232421875, 59.31963348388672, 610 70.78031921386719, 35.56179428100586, 82.53382873535156, 611 7.572360038757324, 61.90089416503906, 14.084012985229492, 612 90.86540985107422, 39.56248474121094, 67.77167510986328, 613 69.69512176513672, 89.54518127441406 614 ], 615 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 616 } 617 }, 618 'operators': [{ 619 'name': 'l2Pool2d', 620 'arguments': [ 621 {'input': 'l2Pool2dInput'}, { 622 'options': { 623 'windowDimensions': [3, 3], 624 'padding': [1, 0, 0, 1], 625 'strides': [2, 2], 626 'roundingType': 'ceil', 627 'outputSizes': [2, 2] 628 } 629 } 630 ], 631 'outputs': 'l2Pool2dOutput' 632 }], 633 'expectedOutputs': { 634 'l2Pool2dOutput': { 635 'data': [ 636 171.5061492919922, 164.9919891357422, 160.0518341064453, 637 149.63897705078125, 142.6990966796875, 139.51637268066406, 638 165.07762145996094, 161.11062622070312 639 ], 640 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} 641 } 642 } 643 } 644 }, 645 { 646 'name': 'l2Pool2d float32 4D tensor options.dilations with options.strides', 647 'graph': { 648 'inputs': { 649 'l2Pool2dInput': { 650 'data': [ 651 6.5550384521484375, 26.254413604736328, 28.47271156311035, 652 64.81202697753906, 39.65838623046875, 10.465584754943848, 653 47.94060134887695, 42.208946228027344, 36.834041595458984, 654 68.50249481201172, 2.0496721267700195, 49.73927688598633, 655 59.97947311401367, 71.08380889892578, 0.20033331215381622, 656 19.39293670654297, 70.1269302368164, 86.8837661743164, 657 84.28858184814453, 9.695697784423828, 62.69126510620117, 658 51.924110412597656, 5.412675857543945, 70.82118225097656, 659 81.61302947998047, 29.148712158203125, 85.83409881591797, 660 71.36548614501953, 44.09445571899414, 58.343570709228516, 661 43.37118148803711, 54.025882720947266, 85.50556945800781, 662 93.19215393066406, 10.992993354797363, 34.864158630371094, 663 96.2605209350586, 44.29584503173828, 61.12482833862305, 664 79.62699127197266, 4.066447734832764, 64.89644622802734, 665 97.5897445678711, 11.257055282592773, 61.151283264160156, 666 20.312341690063477, 39.862640380859375, 68.747314453125, 667 89.61034393310547, 22.28224754333496, 41.36311721801758, 668 62.9378662109375, 79.54936218261719, 55.64254379272461, 669 54.47548294067383, 77.04864501953125, 56.83576965332031, 670 80.57747650146484, 70.43293762207031, 85.67094421386719, 671 19.527807235717773, 33.87490463256836, 14.498117446899414, 672 92.85955810546875, 96.8167724609375, 28.399721145629883, 673 99.917236328125, 48.76692199707031, 86.08634948730469, 674 47.32324981689453, 7.223662376403809, 82.97200775146484, 675 38.374778747558594, 22.10988426208496, 14.797550201416016, 676 2.3872148990631104, 83.26342010498047, 46.41500473022461, 677 28.659175872802734, 13.919462203979492, 55.413089752197266, 678 62.68498992919922, 78.54127502441406, 31.142845153808594, 679 4.806727886199951, 33.233642578125, 24.749773025512695, 680 1.529007077217102, 42.976322174072266, 93.08572387695312, 681 77.908935546875, 45.74395751953125, 62.868892669677734, 682 60.689762115478516, 20.046878814697266, 13.203198432922363, 683 33.33952713012695, 0.5279953479766846 684 ], 685 'descriptor': {shape: [1, 7, 7, 2], dataType: 'float32'} 686 } 687 }, 688 'operators': [{ 689 'name': 'l2Pool2d', 690 'arguments': [ 691 {'input': 'l2Pool2dInput'}, { 692 'options': { 693 'windowDimensions': [3, 3], 694 'padding': [1, 0, 0, 1], 695 'strides': [2, 2], 696 'dilations': [1, 1], 697 'layout': 'nhwc' 698 } 699 } 700 ], 701 'outputs': 'l2Pool2dOutput' 702 }], 703 'expectedOutputs': { 704 'l2Pool2dOutput': { 705 'data': [ 706 120.20333862304688, 114.0977783203125, 127.63969421386719, 707 119.95613861083984, 137.89837646484375, 152.24261474609375, 708 194.9647216796875, 168.20205688476562, 197.7173309326172, 709 169.85887145996094, 195.1484832763672, 190.96127319335938, 710 158.64576721191406, 166.2051544189453, 171.07916259765625, 711 148.70985412597656, 218.7123260498047, 153.33311462402344 712 ], 713 'descriptor': {shape: [1, 3, 3, 2], dataType: 'float32'} 714 } 715 } 716 } 717 }, 718 719 // float16 tests 720 { 721 'name': 'l2Pool2d float16 4D constant tensor all positive default options', 722 'graph': { 723 'inputs': { 724 'l2Pool2dInput': { 725 'data': [ 726 94.0625, 76.5625, 62.71875, 727 83.875, 73.125, 41.53125, 728 39.34375, 86.625, 23.09375, 729 53.65625, 0.0090179443359375, 42.78125, 730 81.0625, 33.5, 33.6875, 731 0.42822265625, 80.0625, 5.9296875, 732 48.90625, 15.28125, 13.3359375, 733 39.0625, 97.0625, 83.6875, 734 21.796875, 52.03125, 6.3984375, 735 84.5625, 18.625, 34.09375, 736 74, 36.15625, 60.75, 737 55.09375, 63.90625, 59.375, 738 50.90625, 50.34375, 59.3125, 739 70.75, 35.5625, 82.5625, 740 7.57421875, 61.90625, 14.0859375, 741 90.875, 39.5625, 67.75, 742 69.6875, 89.5625 743 ], 744 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'}, 745 'constant': true 746 } 747 }, 748 'operators': [{ 749 'name': 'l2Pool2d', 750 'arguments': [{'input': 'l2Pool2dInput'}], 751 'outputs': 'l2Pool2dOutput' 752 }], 753 'expectedOutputs': { 754 'l2Pool2dOutput': { 755 'data': [289, 292.75], 756 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float16'} 757 } 758 } 759 } 760 }, 761 { 762 'name': 'l2Pool2d float16 4D tensor all positive default options', 763 'graph': { 764 'inputs': { 765 'l2Pool2dInput': { 766 'data': [ 767 94.0625, 76.5625, 62.71875, 768 83.875, 73.125, 41.53125, 769 39.34375, 86.625, 23.09375, 770 53.65625, 0.0090179443359375, 42.78125, 771 81.0625, 33.5, 33.6875, 772 0.42822265625, 80.0625, 5.9296875, 773 48.90625, 15.28125, 13.3359375, 774 39.0625, 97.0625, 83.6875, 775 21.796875, 52.03125, 6.3984375, 776 84.5625, 18.625, 34.09375, 777 74, 36.15625, 60.75, 778 55.09375, 63.90625, 59.375, 779 50.90625, 50.34375, 59.3125, 780 70.75, 35.5625, 82.5625, 781 7.57421875, 61.90625, 14.0859375, 782 90.875, 39.5625, 67.75, 783 69.6875, 89.5625 784 ], 785 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 786 } 787 }, 788 'operators': [{ 789 'name': 'l2Pool2d', 790 'arguments': [{'input': 'l2Pool2dInput'}], 791 'outputs': 'l2Pool2dOutput' 792 }], 793 'expectedOutputs': { 794 'l2Pool2dOutput': { 795 'data': [289, 292.75], 796 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float16'} 797 } 798 } 799 } 800 }, 801 { 802 'name': 'l2Pool2d float16 4D tensor all negative default options', 803 'graph': { 804 'inputs': { 805 'l2Pool2dInput': { 806 'data': [ 807 -1.1953125, -9.703125, -39.5625, -82.375, -32.875, -50.21875, 808 -31.171875, -55.8125, -46.71875, -38.6875, -63.3125, -35.09375, 809 -80.9375, -82.875, -40.40625, -34.875, -84.3125, -84.125, 810 -5.5234375, -99, -75.5, -91.4375, -96.6875, -16.71875, 811 -17.984375, -58.0625, -11.84375, -97.875, -38.6875, -80.1875, 812 -48.71875, -90.875, -99.125, -79.6875, -59.375, -9.96875, 813 -39.28125, -10.46875, -27.5625, -2.046875, -81.875, -66.875, 814 -86, -29.671875, -19.65625, -89.375, -61.125, -84.1875, 815 -77.375, -91.1875 816 ], 817 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 818 } 819 }, 820 'operators': [{ 821 'name': 'l2Pool2d', 822 'arguments': [{'input': 'l2Pool2dInput'}], 823 'outputs': 'l2Pool2dOutput' 824 }], 825 'expectedOutputs': { 826 'l2Pool2dOutput': { 827 'data': [299, 326.75], 828 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float16'} 829 } 830 } 831 } 832 }, 833 { 834 'name': 'l2Pool2d float16 4D tensor options.windowDimensions', 835 'graph': { 836 'inputs': { 837 'l2Pool2dInput': { 838 'data': [ 839 94.0625, 76.5625, 62.71875, 840 83.875, 73.125, 41.53125, 841 39.34375, 86.625, 23.09375, 842 53.65625, 0.0090179443359375, 42.78125, 843 81.0625, 33.5, 33.6875, 844 0.42822265625, 80.0625, 5.9296875, 845 48.90625, 15.28125, 13.3359375, 846 39.0625, 97.0625, 83.6875, 847 21.796875, 52.03125, 6.3984375, 848 84.5625, 18.625, 34.09375, 849 74, 36.15625, 60.75, 850 55.09375, 63.90625, 59.375, 851 50.90625, 50.34375, 59.3125, 852 70.75, 35.5625, 82.5625, 853 7.57421875, 61.90625, 14.0859375, 854 90.875, 39.5625, 67.75, 855 69.6875, 89.5625 856 ], 857 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 858 } 859 }, 860 'operators': [{ 861 'name': 'l2Pool2d', 862 'arguments': [ 863 {'input': 'l2Pool2dInput'}, {'options': {'windowDimensions': [3, 3]}} 864 ], 865 'outputs': 'l2Pool2dOutput' 866 }], 867 'expectedOutputs': { 868 'l2Pool2dOutput': { 869 'data': [ 870 194.5, 189.625, 189.875, 160.125, 167.125, 149.625, 161.125, 190.5, 871 168.5, 170.375, 155.625, 174.75, 165.125, 165.5, 161.125, 176.625, 872 174.25, 180.625 873 ], 874 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float16'} 875 } 876 } 877 } 878 }, 879 { 880 'name': 'l2Pool2d float16 4D tensor options.padding', 881 'graph': { 882 'inputs': { 883 'l2Pool2dInput': { 884 'data': [ 885 94.0625, 76.5625, 62.71875, 886 83.875, 73.125, 41.53125, 887 39.34375, 86.625, 23.09375, 888 53.65625, 0.0090179443359375, 42.78125, 889 81.0625, 33.5, 33.6875, 890 0.42822265625, 80.0625, 5.9296875, 891 48.90625, 15.28125, 13.3359375, 892 39.0625, 97.0625, 83.6875, 893 21.796875, 52.03125, 6.3984375, 894 84.5625, 18.625, 34.09375, 895 74, 36.15625, 60.75, 896 55.09375, 63.90625, 59.375, 897 50.90625, 50.34375, 59.3125, 898 70.75, 35.5625, 82.5625, 899 7.57421875, 61.90625, 14.0859375, 900 90.875, 39.5625, 67.75, 901 69.6875, 89.5625 902 ], 903 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 904 } 905 }, 906 'operators': [{ 907 'name': 'l2Pool2d', 908 'arguments': [ 909 {'input': 'l2Pool2dInput'}, {'options': {'padding': [1, 0, 0, 1]}} 910 ], 911 'outputs': 'l2Pool2dOutput' 912 }], 913 'expectedOutputs': { 914 'l2Pool2dOutput': { 915 'data': [254.875, 233.125, 289, 269.75, 241.5, 213, 292.75, 253.75], 916 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float16'} 917 } 918 } 919 } 920 }, 921 { 922 'name': 'l2Pool2d float16 4D tensor options.strides', 923 'graph': { 924 'inputs': { 925 'l2Pool2dInput': { 926 'data': [ 927 94.0625, 76.5625, 62.71875, 928 83.875, 73.125, 41.53125, 929 39.34375, 86.625, 23.09375, 930 53.65625, 0.0090179443359375, 42.78125, 931 81.0625, 33.5, 33.6875, 932 0.42822265625, 80.0625, 5.9296875, 933 48.90625, 15.28125, 13.3359375, 934 39.0625, 97.0625, 83.6875, 935 21.796875, 52.03125, 6.3984375, 936 84.5625, 18.625, 34.09375, 937 74, 36.15625, 60.75, 938 55.09375, 63.90625, 59.375, 939 50.90625, 50.34375, 59.3125, 940 70.75, 35.5625, 82.5625, 941 7.57421875, 61.90625, 14.0859375, 942 90.875, 39.5625, 67.75, 943 69.6875, 89.5625 944 ], 945 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 946 } 947 }, 948 'operators': [{ 949 'name': 'l2Pool2d', 950 'arguments': [ 951 {'input': 'l2Pool2dInput'}, 952 {'options': {'windowDimensions': [3, 3], 'strides': [2, 2]}} 953 ], 954 'outputs': 'l2Pool2dOutput' 955 }], 956 'expectedOutputs': { 957 'l2Pool2dOutput': { 958 'data': [ 959 194.5, 189.875, 161.125, 168.5, 170.375, 174.75, 176.625, 180.625 960 ], 961 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float16'} 962 } 963 } 964 } 965 }, 966 { 967 'name': 'l2Pool2d float16 4D tensor options.dilations', 968 'graph': { 969 'inputs': { 970 'l2Pool2dInput': { 971 'data': [ 972 94.0625, 76.5625, 62.71875, 973 83.875, 73.125, 41.53125, 974 39.34375, 86.625, 23.09375, 975 53.65625, 0.0090179443359375, 42.78125, 976 81.0625, 33.5, 33.6875, 977 0.42822265625, 80.0625, 5.9296875, 978 48.90625, 15.28125, 13.3359375, 979 39.0625, 97.0625, 83.6875, 980 21.796875, 52.03125, 6.3984375, 981 84.5625, 18.625, 34.09375, 982 74, 36.15625, 60.75, 983 55.09375, 63.90625, 59.375, 984 50.90625, 50.34375, 59.3125, 985 70.75, 35.5625, 82.5625, 986 7.57421875, 61.90625, 14.0859375, 987 90.875, 39.5625, 67.75, 988 69.6875, 89.5625 989 ], 990 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 991 } 992 }, 993 'operators': [{ 994 'name': 'l2Pool2d', 995 'arguments': [ 996 {'input': 'l2Pool2dInput'}, 997 {'options': {'windowDimensions': [3, 3], 'dilations': [2, 2]}} 998 ], 999 'outputs': 'l2Pool2dOutput' 1000 }], 1001 'expectedOutputs': { 1002 'l2Pool2dOutput': { 1003 'data': [189.5, 207.25], 1004 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float16'} 1005 } 1006 } 1007 } 1008 }, 1009 { 1010 'name': 'l2Pool2d float16 4D tensor options.layout=nchw', 1011 'graph': { 1012 'inputs': { 1013 'l2Pool2dInput': { 1014 'data': [ 1015 94.0625, 76.5625, 62.71875, 1016 83.875, 73.125, 41.53125, 1017 39.34375, 86.625, 23.09375, 1018 53.65625, 0.0090179443359375, 42.78125, 1019 81.0625, 33.5, 33.6875, 1020 0.42822265625, 80.0625, 5.9296875, 1021 48.90625, 15.28125, 13.3359375, 1022 39.0625, 97.0625, 83.6875, 1023 21.796875, 52.03125, 6.3984375, 1024 84.5625, 18.625, 34.09375, 1025 74, 36.15625, 60.75, 1026 55.09375, 63.90625, 59.375, 1027 50.90625, 50.34375, 59.3125, 1028 70.75, 35.5625, 82.5625, 1029 7.57421875, 61.90625, 14.0859375, 1030 90.875, 39.5625, 67.75, 1031 69.6875, 89.5625 1032 ], 1033 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 1034 } 1035 }, 1036 'operators': [{ 1037 'name': 'l2Pool2d', 1038 'arguments': 1039 [{'input': 'l2Pool2dInput'}, {'options': {'layout': 'nchw'}}], 1040 'outputs': 'l2Pool2dOutput' 1041 }], 1042 'expectedOutputs': { 1043 'l2Pool2dOutput': { 1044 'data': [289, 292.75], 1045 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float16'} 1046 } 1047 } 1048 } 1049 }, 1050 { 1051 'name': 'l2Pool2d float16 4D tensor options.layout=nhwc', 1052 'graph': { 1053 'inputs': { 1054 'l2Pool2dInput': { 1055 'data': [ 1056 94.0625, 52.03125, 76.5625, 1057 6.3984375, 62.71875, 84.5625, 1058 83.875, 18.625, 73.125, 1059 34.09375, 41.53125, 74, 1060 39.34375, 36.15625, 86.625, 1061 60.75, 23.09375, 55.09375, 1062 53.65625, 63.90625, 0.0090179443359375, 1063 59.375, 42.78125, 50.90625, 1064 81.0625, 50.34375, 33.5, 1065 59.3125, 33.6875, 70.75, 1066 0.42822265625, 35.5625, 80.0625, 1067 82.5625, 5.9296875, 7.57421875, 1068 48.90625, 61.90625, 15.28125, 1069 14.0859375, 13.3359375, 90.875, 1070 39.0625, 39.5625, 97.0625, 1071 67.75, 83.6875, 69.6875, 1072 21.796875, 89.5625 1073 ], 1074 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float16'} 1075 } 1076 }, 1077 'operators': [{ 1078 'name': 'l2Pool2d', 1079 'arguments': 1080 [{'input': 'l2Pool2dInput'}, {'options': {'layout': 'nhwc'}}], 1081 'outputs': 'l2Pool2dOutput' 1082 }], 1083 'expectedOutputs': { 1084 'l2Pool2dOutput': { 1085 'data': [289, 292.75], 1086 'descriptor': {shape: [1, 1, 1, 2], dataType: 'float16'} 1087 } 1088 } 1089 } 1090 }, 1091 { 1092 'name': 'l2Pool2d float16 4D tensor options.roundingType=floor', 1093 'graph': { 1094 'inputs': { 1095 'l2Pool2dInput': { 1096 'data': [ 1097 94.0625, 76.5625, 62.71875, 1098 83.875, 73.125, 41.53125, 1099 39.34375, 86.625, 23.09375, 1100 53.65625, 0.0090179443359375, 42.78125, 1101 81.0625, 33.5, 33.6875, 1102 0.42822265625, 80.0625, 5.9296875, 1103 48.90625, 15.28125, 13.3359375, 1104 39.0625, 97.0625, 83.6875, 1105 21.796875, 52.03125, 6.3984375, 1106 84.5625, 18.625, 34.09375, 1107 74, 36.15625, 60.75, 1108 55.09375, 63.90625, 59.375, 1109 50.90625, 50.34375, 59.3125, 1110 70.75, 35.5625, 82.5625, 1111 7.57421875, 61.90625, 14.0859375, 1112 90.875, 39.5625, 67.75, 1113 69.6875, 89.5625 1114 ], 1115 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 1116 } 1117 }, 1118 'operators': [{ 1119 'name': 'l2Pool2d', 1120 'arguments': [ 1121 {'input': 'l2Pool2dInput'}, { 1122 'options': { 1123 'windowDimensions': [3, 3], 1124 'padding': [1, 0, 0, 1], 1125 'strides': [2, 2], 1126 'roundingType': 'floor' 1127 } 1128 } 1129 ], 1130 'outputs': 'l2Pool2dOutput' 1131 }], 1132 'expectedOutputs': { 1133 'l2Pool2dOutput': { 1134 'data': 1135 [171.5, 165, 160.125, 149.625, 142.75, 139.5, 165.125, 161.125], 1136 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float16'} 1137 } 1138 } 1139 } 1140 }, 1141 { 1142 'name': 'l2Pool2d float16 4D tensor options.roundingType=ceil', 1143 'graph': { 1144 'inputs': { 1145 'l2Pool2dInput': { 1146 'data': [ 1147 94.0625, 76.5625, 62.71875, 1148 83.875, 73.125, 41.53125, 1149 39.34375, 86.625, 23.09375, 1150 53.65625, 0.0090179443359375, 42.78125, 1151 81.0625, 33.5, 33.6875, 1152 0.42822265625, 80.0625, 5.9296875, 1153 48.90625, 15.28125, 13.3359375, 1154 39.0625, 97.0625, 83.6875, 1155 21.796875, 52.03125, 6.3984375, 1156 84.5625, 18.625, 34.09375, 1157 74, 36.15625, 60.75, 1158 55.09375, 63.90625, 59.375, 1159 50.90625, 50.34375, 59.3125, 1160 70.75, 35.5625, 82.5625, 1161 7.57421875, 61.90625, 14.0859375, 1162 90.875, 39.5625, 67.75, 1163 69.6875, 89.5625 1164 ], 1165 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 1166 } 1167 }, 1168 'operators': [{ 1169 'name': 'l2Pool2d', 1170 'arguments': [ 1171 {'input': 'l2Pool2dInput'}, { 1172 'options': { 1173 'windowDimensions': [3, 3], 1174 'padding': [1, 0, 0, 1], 1175 'strides': [2, 2], 1176 'roundingType': 'ceil' 1177 } 1178 } 1179 ], 1180 'outputs': 'l2Pool2dOutput' 1181 }], 1182 'expectedOutputs': { 1183 'l2Pool2dOutput': { 1184 'data': [ 1185 171.5, 165, 90.6875, 160.125, 149.625, 65.1875, 132.5, 139.875, 1186 26.625, 142.75, 139.5, 72.4375, 165.125, 161.125, 96.375, 150.125, 1187 146.875, 90.6875 1188 ], 1189 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float16'} 1190 } 1191 } 1192 } 1193 }, 1194 { 1195 'name': 1196 'l2Pool2d float16 4D tensor options.outputSizes ignores options.roundingType=floor', 1197 'graph': { 1198 'inputs': { 1199 'l2Pool2dInput': { 1200 'data': [ 1201 94.0625, 76.5625, 62.71875, 1202 83.875, 73.125, 41.53125, 1203 39.34375, 86.625, 23.09375, 1204 53.65625, 0.0090179443359375, 42.78125, 1205 81.0625, 33.5, 33.6875, 1206 0.42822265625, 80.0625, 5.9296875, 1207 48.90625, 15.28125, 13.3359375, 1208 39.0625, 97.0625, 83.6875, 1209 21.796875, 52.03125, 6.3984375, 1210 84.5625, 18.625, 34.09375, 1211 74, 36.15625, 60.75, 1212 55.09375, 63.90625, 59.375, 1213 50.90625, 50.34375, 59.3125, 1214 70.75, 35.5625, 82.5625, 1215 7.57421875, 61.90625, 14.0859375, 1216 90.875, 39.5625, 67.75, 1217 69.6875, 89.5625 1218 ], 1219 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 1220 } 1221 }, 1222 'operators': [{ 1223 'name': 'l2Pool2d', 1224 'arguments': [ 1225 {'input': 'l2Pool2dInput'}, { 1226 'options': { 1227 'windowDimensions': [3, 3], 1228 'padding': [1, 0, 0, 1], 1229 'strides': [2, 2], 1230 'roundingType': 'floor', 1231 'outputSizes': [3, 3] 1232 } 1233 } 1234 ], 1235 'outputs': 'l2Pool2dOutput' 1236 }], 1237 'expectedOutputs': { 1238 'l2Pool2dOutput': { 1239 'data': [ 1240 171.5, 165, 90.6875, 160.125, 149.625, 65.1875, 132.5, 139.875, 1241 26.625, 142.75, 139.5, 72.4375, 165.125, 161.125, 96.375, 150.125, 1242 146.875, 90.6875 1243 ], 1244 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float16'} 1245 } 1246 } 1247 } 1248 }, 1249 { 1250 'name': 1251 'l2Pool2d float16 4D tensor options.outputSizes ignores options.roundingType=ceil', 1252 'graph': { 1253 'inputs': { 1254 'l2Pool2dInput': { 1255 'data': [ 1256 94.0625, 76.5625, 62.71875, 1257 83.875, 73.125, 41.53125, 1258 39.34375, 86.625, 23.09375, 1259 53.65625, 0.0090179443359375, 42.78125, 1260 81.0625, 33.5, 33.6875, 1261 0.42822265625, 80.0625, 5.9296875, 1262 48.90625, 15.28125, 13.3359375, 1263 39.0625, 97.0625, 83.6875, 1264 21.796875, 52.03125, 6.3984375, 1265 84.5625, 18.625, 34.09375, 1266 74, 36.15625, 60.75, 1267 55.09375, 63.90625, 59.375, 1268 50.90625, 50.34375, 59.3125, 1269 70.75, 35.5625, 82.5625, 1270 7.57421875, 61.90625, 14.0859375, 1271 90.875, 39.5625, 67.75, 1272 69.6875, 89.5625 1273 ], 1274 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 1275 } 1276 }, 1277 'operators': [{ 1278 'name': 'l2Pool2d', 1279 'arguments': [ 1280 {'input': 'l2Pool2dInput'}, { 1281 'options': { 1282 'windowDimensions': [3, 3], 1283 'padding': [1, 0, 0, 1], 1284 'strides': [2, 2], 1285 'roundingType': 'ceil', 1286 'outputSizes': [2, 2] 1287 } 1288 } 1289 ], 1290 'outputs': 'l2Pool2dOutput' 1291 }], 1292 'expectedOutputs': { 1293 'l2Pool2dOutput': { 1294 'data': 1295 [171.5, 165, 160.125, 149.625, 142.75, 139.5, 165.125, 161.125], 1296 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float16'} 1297 } 1298 } 1299 } 1300 }, 1301 { 1302 'name': 'l2Pool2d float16 4D tensor options.dilations with options.strides', 1303 'graph': { 1304 'inputs': { 1305 'l2Pool2dInput': { 1306 'data': [ 1307 6.5546875, 26.25, 28.46875, 64.8125, 39.65625, 1308 10.46875, 47.9375, 42.21875, 36.84375, 68.5, 1309 2.048828125, 49.75, 59.96875, 71.0625, 0.2003173828125, 1310 19.390625, 70.125, 86.875, 84.3125, 9.6953125, 1311 62.6875, 51.9375, 5.4140625, 70.8125, 81.625, 1312 29.15625, 85.8125, 71.375, 44.09375, 58.34375, 1313 43.375, 54.03125, 85.5, 93.1875, 10.9921875, 1314 34.875, 96.25, 44.28125, 61.125, 79.625, 1315 4.06640625, 64.875, 97.5625, 11.2578125, 61.15625, 1316 20.3125, 39.875, 68.75, 89.625, 22.28125, 1317 41.375, 62.9375, 79.5625, 55.65625, 54.46875, 1318 77.0625, 56.84375, 80.5625, 70.4375, 85.6875, 1319 19.53125, 33.875, 14.5, 92.875, 96.8125, 1320 28.40625, 99.9375, 48.78125, 86.0625, 47.3125, 1321 7.22265625, 83, 38.375, 22.109375, 14.796875, 1322 2.38671875, 83.25, 46.40625, 28.65625, 13.921875, 1323 55.40625, 62.6875, 78.5625, 31.140625, 4.80859375, 1324 33.21875, 24.75, 1.529296875, 42.96875, 93.0625, 1325 77.9375, 45.75, 62.875, 60.6875, 20.046875, 1326 13.203125, 33.34375, 0.52783203125 1327 ], 1328 'descriptor': {shape: [1, 7, 7, 2], dataType: 'float16'} 1329 } 1330 }, 1331 'operators': [{ 1332 'name': 'l2Pool2d', 1333 'arguments': [ 1334 {'input': 'l2Pool2dInput'}, { 1335 'options': { 1336 'windowDimensions': [3, 3], 1337 'padding': [1, 0, 0, 1], 1338 'strides': [2, 2], 1339 'dilations': [1, 1], 1340 'layout': 'nhwc' 1341 } 1342 } 1343 ], 1344 'outputs': 'l2Pool2dOutput' 1345 }], 1346 'expectedOutputs': { 1347 'l2Pool2dOutput': { 1348 'data': [ 1349 120.1875, 114.0625, 127.625, 119.9375, 137.875, 152.25, 195, 168.25, 1350 197.75, 169.875, 195.125, 191, 158.625, 166.25, 171.125, 148.75, 1351 218.75, 153.375 1352 ], 1353 'descriptor': {shape: [1, 3, 3, 2], dataType: 'float16'} 1354 } 1355 } 1356 } 1357 } 1358 ]; 1359 1360 webnn_conformance_test( 1361 l2Pool2dTests, buildAndExecuteGraph, getPrecisionTolerance);