maxPool2d.https.any.js (50206B)
1 // META: title=test WebNN API maxPool2d 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 maxPool2d( 31 // MLOperand input, optional MLPool2dOptions options = {}); 32 33 const maxPool2dTests = [ 34 // float32 tests 35 { 36 'name': 'maxPool2d float32 4D constant tensor default options', 37 'graph': { 38 'inputs': { 39 'maxPool2dInput': { 40 'data': [ 41 89.00830078125, -45.72039031982422, -61.306129455566406, 42 -4.014514446258545, -94.54893493652344, 46.28090286254883, 43 99.28312683105469, -10.057873725891113, 9.742474555969238, 44 -39.03501892089844, 75.08192443847656, 12.819415092468262, 45 -33.01505661010742, 38.691341400146484, 66.09259033203125, 46 97.90348052978516, -8.737770080566406, -53.42162322998047, 47 72.1085205078125, -40.423091888427734, -35.68864440917969, 48 -87.64779663085938, 38.874244689941406, 39.383602142333984, 49 7.429088115692139, -76.72171020507812, 50.217063903808594, 50 -52.895477294921875, -44.642333984375, -97.86752319335938, 51 81.73119354248047, 5.428491115570068, -29.22772789001465, 52 72.44898986816406, -59.34124755859375, 39.19960021972656, 53 -65.99439239501953, -4.204323768615723, -60.54586410522461, 54 55.890525817871094, 80.30484008789062, 72.8883056640625, 55 -46.59611129760742, 20.50387954711914, -31.126462936401367, 56 -57.294559478759766, -26.623577117919922, 15.935754776000977, 57 -78.77953338623047, 72.33577728271484 58 ], 59 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'}, 60 'constant': true 61 } 62 }, 63 'operators': [{ 64 'name': 'maxPool2d', 65 'arguments': [{'input': 'maxPool2dInput'}], 66 'outputs': 'maxPool2dOutput' 67 }], 68 'expectedOutputs': { 69 'maxPool2dOutput': { 70 'data': [99.28312683105469, 81.73119354248047], 71 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} 72 } 73 } 74 } 75 }, 76 { 77 'name': 'maxPool2d float32 4D tensor default options', 78 'graph': { 79 'inputs': { 80 'maxPool2dInput': { 81 'data': [ 82 89.00830078125, -45.72039031982422, -61.306129455566406, 83 -4.014514446258545, -94.54893493652344, 46.28090286254883, 84 99.28312683105469, -10.057873725891113, 9.742474555969238, 85 -39.03501892089844, 75.08192443847656, 12.819415092468262, 86 -33.01505661010742, 38.691341400146484, 66.09259033203125, 87 97.90348052978516, -8.737770080566406, -53.42162322998047, 88 72.1085205078125, -40.423091888427734, -35.68864440917969, 89 -87.64779663085938, 38.874244689941406, 39.383602142333984, 90 7.429088115692139, -76.72171020507812, 50.217063903808594, 91 -52.895477294921875, -44.642333984375, -97.86752319335938, 92 81.73119354248047, 5.428491115570068, -29.22772789001465, 93 72.44898986816406, -59.34124755859375, 39.19960021972656, 94 -65.99439239501953, -4.204323768615723, -60.54586410522461, 95 55.890525817871094, 80.30484008789062, 72.8883056640625, 96 -46.59611129760742, 20.50387954711914, -31.126462936401367, 97 -57.294559478759766, -26.623577117919922, 15.935754776000977, 98 -78.77953338623047, 72.33577728271484 99 ], 100 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 101 } 102 }, 103 'operators': [{ 104 'name': 'maxPool2d', 105 'arguments': [{'input': 'maxPool2dInput'}], 106 'outputs': 'maxPool2dOutput' 107 }], 108 'expectedOutputs': { 109 'maxPool2dOutput': { 110 'data': [99.28312683105469, 81.73119354248047], 111 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} 112 } 113 } 114 } 115 }, 116 { 117 'name': 'maxPool2d float32 4D tensor options.windowDimensions', 118 'graph': { 119 'inputs': { 120 'maxPool2dInput': { 121 'data': [ 122 89.00830078125, -45.72039031982422, -61.306129455566406, 123 -4.014514446258545, -94.54893493652344, 46.28090286254883, 124 99.28312683105469, -10.057873725891113, 9.742474555969238, 125 -39.03501892089844, 75.08192443847656, 12.819415092468262, 126 -33.01505661010742, 38.691341400146484, 66.09259033203125, 127 97.90348052978516, -8.737770080566406, -53.42162322998047, 128 72.1085205078125, -40.423091888427734, -35.68864440917969, 129 -87.64779663085938, 38.874244689941406, 39.383602142333984, 130 7.429088115692139, -76.72171020507812, 50.217063903808594, 131 -52.895477294921875, -44.642333984375, -97.86752319335938, 132 81.73119354248047, 5.428491115570068, -29.22772789001465, 133 72.44898986816406, -59.34124755859375, 39.19960021972656, 134 -65.99439239501953, -4.204323768615723, -60.54586410522461, 135 55.890525817871094, 80.30484008789062, 72.8883056640625, 136 -46.59611129760742, 20.50387954711914, -31.126462936401367, 137 -57.294559478759766, -26.623577117919922, 15.935754776000977, 138 -78.77953338623047, 72.33577728271484 139 ], 140 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 141 } 142 }, 143 'operators': [{ 144 'name': 'maxPool2d', 145 'arguments': [ 146 {'input': 'maxPool2dInput'}, {'options': {'windowDimensions': [3, 3]}} 147 ], 148 'outputs': 'maxPool2dOutput' 149 }], 150 'expectedOutputs': { 151 'maxPool2dOutput': { 152 'data': [ 153 99.28312683105469, 99.28312683105469, 66.09259033203125, 154 99.28312683105469, 99.28312683105469, 72.1085205078125, 155 97.90348052978516, 72.1085205078125, 72.1085205078125, 156 81.73119354248047, 72.44898986816406, 72.44898986816406, 157 81.73119354248047, 72.8883056640625, 72.44898986816406, 158 80.30484008789062, 72.8883056640625, 72.33577728271484 159 ], 160 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} 161 } 162 } 163 } 164 }, 165 { 166 'name': 'maxPool2d float32 4D tensor options.padding', 167 'graph': { 168 'inputs': { 169 'maxPool2dInput': { 170 'data': [ 171 89.00830078125, -45.72039031982422, -61.306129455566406, 172 -4.014514446258545, -94.54893493652344, 46.28090286254883, 173 99.28312683105469, -10.057873725891113, 9.742474555969238, 174 -39.03501892089844, 75.08192443847656, 12.819415092468262, 175 -33.01505661010742, 38.691341400146484, 66.09259033203125, 176 97.90348052978516, -8.737770080566406, -53.42162322998047, 177 72.1085205078125, -40.423091888427734, -35.68864440917969, 178 -87.64779663085938, 38.874244689941406, 39.383602142333984, 179 7.429088115692139, -76.72171020507812, 50.217063903808594, 180 -52.895477294921875, -44.642333984375, -97.86752319335938, 181 81.73119354248047, 5.428491115570068, -29.22772789001465, 182 72.44898986816406, -59.34124755859375, 39.19960021972656, 183 -65.99439239501953, -4.204323768615723, -60.54586410522461, 184 55.890525817871094, 80.30484008789062, 72.8883056640625, 185 -46.59611129760742, 20.50387954711914, -31.126462936401367, 186 -57.294559478759766, -26.623577117919922, 15.935754776000977, 187 -78.77953338623047, 72.33577728271484 188 ], 189 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 190 } 191 }, 192 'operators': [{ 193 'name': 'maxPool2d', 194 'arguments': [ 195 {'input': 'maxPool2dInput'}, {'options': {'padding': [1, 0, 0, 1]}} 196 ], 197 'outputs': 'maxPool2dOutput' 198 }], 199 'expectedOutputs': { 200 'maxPool2dOutput': { 201 'data': [ 202 99.28312683105469, 99.28312683105469, 99.28312683105469, 203 99.28312683105469, 81.73119354248047, 72.8883056640625, 204 81.73119354248047, 72.8883056640625 205 ], 206 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} 207 } 208 } 209 } 210 }, 211 { 212 'name': 'maxPool2d float32 4D tensor options.strides', 213 'graph': { 214 'inputs': { 215 'maxPool2dInput': { 216 'data': [ 217 89.00830078125, -45.72039031982422, -61.306129455566406, 218 -4.014514446258545, -94.54893493652344, 46.28090286254883, 219 99.28312683105469, -10.057873725891113, 9.742474555969238, 220 -39.03501892089844, 75.08192443847656, 12.819415092468262, 221 -33.01505661010742, 38.691341400146484, 66.09259033203125, 222 97.90348052978516, -8.737770080566406, -53.42162322998047, 223 72.1085205078125, -40.423091888427734, -35.68864440917969, 224 -87.64779663085938, 38.874244689941406, 39.383602142333984, 225 7.429088115692139, -76.72171020507812, 50.217063903808594, 226 -52.895477294921875, -44.642333984375, -97.86752319335938, 227 81.73119354248047, 5.428491115570068, -29.22772789001465, 228 72.44898986816406, -59.34124755859375, 39.19960021972656, 229 -65.99439239501953, -4.204323768615723, -60.54586410522461, 230 55.890525817871094, 80.30484008789062, 72.8883056640625, 231 -46.59611129760742, 20.50387954711914, -31.126462936401367, 232 -57.294559478759766, -26.623577117919922, 15.935754776000977, 233 -78.77953338623047, 72.33577728271484 234 ], 235 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 236 } 237 }, 238 'operators': [{ 239 'name': 'maxPool2d', 240 'arguments': [ 241 {'input': 'maxPool2dInput'}, 242 {'options': {'windowDimensions': [3, 3], 'strides': [2, 2]}} 243 ], 244 'outputs': 'maxPool2dOutput' 245 }], 246 'expectedOutputs': { 247 'maxPool2dOutput': { 248 'data': [ 249 99.28312683105469, 66.09259033203125, 97.90348052978516, 250 72.1085205078125, 81.73119354248047, 72.44898986816406, 251 80.30484008789062, 72.33577728271484 252 ], 253 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} 254 } 255 } 256 } 257 }, 258 { 259 'name': 'maxPool2d float32 4D tensor options.dilations', 260 'graph': { 261 'inputs': { 262 'maxPool2dInput': { 263 'data': [ 264 89.00830078125, -45.72039031982422, -61.306129455566406, 265 -4.014514446258545, -94.54893493652344, 46.28090286254883, 266 99.28312683105469, -10.057873725891113, 9.742474555969238, 267 -39.03501892089844, 75.08192443847656, 12.819415092468262, 268 -33.01505661010742, 38.691341400146484, 66.09259033203125, 269 97.90348052978516, -8.737770080566406, -53.42162322998047, 270 72.1085205078125, -40.423091888427734, -35.68864440917969, 271 -87.64779663085938, 38.874244689941406, 39.383602142333984, 272 7.429088115692139, -76.72171020507812, 50.217063903808594, 273 -52.895477294921875, -44.642333984375, -97.86752319335938, 274 81.73119354248047, 5.428491115570068, -29.22772789001465, 275 72.44898986816406, -59.34124755859375, 39.19960021972656, 276 -65.99439239501953, -4.204323768615723, -60.54586410522461, 277 55.890525817871094, 80.30484008789062, 72.8883056640625, 278 -46.59611129760742, 20.50387954711914, -31.126462936401367, 279 -57.294559478759766, -26.623577117919922, 15.935754776000977, 280 -78.77953338623047, 72.33577728271484 281 ], 282 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 283 } 284 }, 285 'operators': [{ 286 'name': 'maxPool2d', 287 'arguments': [ 288 {'input': 'maxPool2dInput'}, 289 {'options': {'windowDimensions': [3, 3], 'dilations': [2, 2]}} 290 ], 291 'outputs': 'maxPool2dOutput' 292 }], 293 'expectedOutputs': { 294 'maxPool2dOutput': { 295 'data': [89.00830078125, 72.33577728271484], 296 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} 297 } 298 } 299 } 300 }, 301 { 302 'name': 'maxPool2d float32 4D tensor options.layout=nchw', 303 'graph': { 304 'inputs': { 305 'maxPool2dInput': { 306 'data': [ 307 89.00830078125, -45.72039031982422, -61.306129455566406, 308 -4.014514446258545, -94.54893493652344, 46.28090286254883, 309 99.28312683105469, -10.057873725891113, 9.742474555969238, 310 -39.03501892089844, 75.08192443847656, 12.819415092468262, 311 -33.01505661010742, 38.691341400146484, 66.09259033203125, 312 97.90348052978516, -8.737770080566406, -53.42162322998047, 313 72.1085205078125, -40.423091888427734, -35.68864440917969, 314 -87.64779663085938, 38.874244689941406, 39.383602142333984, 315 7.429088115692139, -76.72171020507812, 50.217063903808594, 316 -52.895477294921875, -44.642333984375, -97.86752319335938, 317 81.73119354248047, 5.428491115570068, -29.22772789001465, 318 72.44898986816406, -59.34124755859375, 39.19960021972656, 319 -65.99439239501953, -4.204323768615723, -60.54586410522461, 320 55.890525817871094, 80.30484008789062, 72.8883056640625, 321 -46.59611129760742, 20.50387954711914, -31.126462936401367, 322 -57.294559478759766, -26.623577117919922, 15.935754776000977, 323 -78.77953338623047, 72.33577728271484 324 ], 325 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 326 } 327 }, 328 'operators': [{ 329 'name': 'maxPool2d', 330 'arguments': 331 [{'input': 'maxPool2dInput'}, {'options': {'layout': 'nchw'}}], 332 'outputs': 'maxPool2dOutput' 333 }], 334 'expectedOutputs': { 335 'maxPool2dOutput': { 336 'data': [99.28312683105469, 81.73119354248047], 337 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} 338 } 339 } 340 } 341 }, 342 { 343 'name': 'maxPool2d float32 4D tensor options.layout=nhwc', 344 'graph': { 345 'inputs': { 346 'maxPool2dInput': { 347 'data': [ 348 89.00830078125, -76.72171020507812, -45.72039031982422, 349 50.217063903808594, -61.306129455566406, -52.895477294921875, 350 -4.014514446258545, -44.642333984375, -94.54893493652344, 351 -97.86752319335938, 46.28090286254883, 81.73119354248047, 352 99.28312683105469, 5.428491115570068, -10.057873725891113, 353 -29.22772789001465, 9.742474555969238, 72.44898986816406, 354 -39.03501892089844, -59.34124755859375, 75.08192443847656, 355 39.19960021972656, 12.819415092468262, -65.99439239501953, 356 -33.01505661010742, -4.204323768615723, 38.691341400146484, 357 -60.54586410522461, 66.09259033203125, 55.890525817871094, 358 97.90348052978516, 80.30484008789062, -8.737770080566406, 359 72.8883056640625, -53.42162322998047, -46.59611129760742, 360 72.1085205078125, 20.50387954711914, -40.423091888427734, 361 -31.126462936401367, -35.68864440917969, -57.294559478759766, 362 -87.64779663085938, -26.623577117919922, 38.874244689941406, 363 15.935754776000977, 39.383602142333984, -78.77953338623047, 364 7.429088115692139, 72.33577728271484 365 ], 366 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float32'} 367 } 368 }, 369 'operators': [{ 370 'name': 'maxPool2d', 371 'arguments': 372 [{'input': 'maxPool2dInput'}, {'options': {'layout': 'nhwc'}}], 373 'outputs': 'maxPool2dOutput' 374 }], 375 'expectedOutputs': { 376 'maxPool2dOutput': { 377 'data': [99.28312683105469, 81.73119354248047], 378 'descriptor': {shape: [1, 1, 1, 2], dataType: 'float32'} 379 } 380 } 381 } 382 }, 383 { 384 'name': 'maxPool2d float32 4D tensor options.roundingType=floor', 385 'graph': { 386 'inputs': { 387 'maxPool2dInput': { 388 'data': [ 389 89.00830078125, -45.72039031982422, -61.306129455566406, 390 -4.014514446258545, -94.54893493652344, 46.28090286254883, 391 99.28312683105469, -10.057873725891113, 9.742474555969238, 392 -39.03501892089844, 75.08192443847656, 12.819415092468262, 393 -33.01505661010742, 38.691341400146484, 66.09259033203125, 394 97.90348052978516, -8.737770080566406, -53.42162322998047, 395 72.1085205078125, -40.423091888427734, -35.68864440917969, 396 -87.64779663085938, 38.874244689941406, 39.383602142333984, 397 7.429088115692139, -76.72171020507812, 50.217063903808594, 398 -52.895477294921875, -44.642333984375, -97.86752319335938, 399 81.73119354248047, 5.428491115570068, -29.22772789001465, 400 72.44898986816406, -59.34124755859375, 39.19960021972656, 401 -65.99439239501953, -4.204323768615723, -60.54586410522461, 402 55.890525817871094, 80.30484008789062, 72.8883056640625, 403 -46.59611129760742, 20.50387954711914, -31.126462936401367, 404 -57.294559478759766, -26.623577117919922, 15.935754776000977, 405 -78.77953338623047, 72.33577728271484 406 ], 407 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 408 } 409 }, 410 'operators': [{ 411 'name': 'maxPool2d', 412 'arguments': [ 413 {'input': 'maxPool2dInput'}, { 414 'options': { 415 'windowDimensions': [3, 3], 416 'padding': [1, 0, 0, 1], 417 'strides': [2, 2], 418 'roundingType': 'floor' 419 } 420 } 421 ], 422 'outputs': 'maxPool2dOutput' 423 }], 424 'expectedOutputs': { 425 'maxPool2dOutput': { 426 'data': [ 427 99.28312683105469, 9.742474555969238, 99.28312683105469, 428 72.1085205078125, 81.73119354248047, 72.44898986816406, 429 81.73119354248047, 72.44898986816406 430 ], 431 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} 432 } 433 } 434 } 435 }, 436 { 437 'name': 'maxPool2d float32 4D tensor options.roundingType=ceil', 438 'graph': { 439 'inputs': { 440 'maxPool2dInput': { 441 'data': [ 442 89.00830078125, -45.72039031982422, -61.306129455566406, 443 -4.014514446258545, -94.54893493652344, 46.28090286254883, 444 99.28312683105469, -10.057873725891113, 9.742474555969238, 445 -39.03501892089844, 75.08192443847656, 12.819415092468262, 446 -33.01505661010742, 38.691341400146484, 66.09259033203125, 447 97.90348052978516, -8.737770080566406, -53.42162322998047, 448 72.1085205078125, -40.423091888427734, -35.68864440917969, 449 -87.64779663085938, 38.874244689941406, 39.383602142333984, 450 7.429088115692139, -76.72171020507812, 50.217063903808594, 451 -52.895477294921875, -44.642333984375, -97.86752319335938, 452 81.73119354248047, 5.428491115570068, -29.22772789001465, 453 72.44898986816406, -59.34124755859375, 39.19960021972656, 454 -65.99439239501953, -4.204323768615723, -60.54586410522461, 455 55.890525817871094, 80.30484008789062, 72.8883056640625, 456 -46.59611129760742, 20.50387954711914, -31.126462936401367, 457 -57.294559478759766, -26.623577117919922, 15.935754776000977, 458 -78.77953338623047, 72.33577728271484 459 ], 460 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 461 } 462 }, 463 'operators': [{ 464 'name': 'maxPool2d', 465 'arguments': [ 466 {'input': 'maxPool2dInput'}, { 467 'options': { 468 'windowDimensions': [3, 3], 469 'padding': [1, 0, 0, 1], 470 'strides': [2, 2], 471 'roundingType': 'ceil' 472 } 473 } 474 ], 475 'outputs': 'maxPool2dOutput' 476 }], 477 'expectedOutputs': { 478 'maxPool2dOutput': { 479 'data': [ 480 99.28312683105469, 9.742474555969238, -39.03501892089844, 481 99.28312683105469, 72.1085205078125, 66.09259033203125, 482 97.90348052978516, 72.1085205078125, 7.429088115692139, 483 81.73119354248047, 72.44898986816406, -59.34124755859375, 484 81.73119354248047, 72.44898986816406, 55.890525817871094, 485 80.30484008789062, 72.33577728271484, 72.33577728271484 486 ], 487 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} 488 } 489 } 490 } 491 }, 492 { 493 'name': 494 'maxPool2d float32 4D tensor options.outputSizes ignores options.roundingType=floor', 495 'graph': { 496 'inputs': { 497 'maxPool2dInput': { 498 'data': [ 499 89.00830078125, -45.72039031982422, -61.306129455566406, 500 -4.014514446258545, -94.54893493652344, 46.28090286254883, 501 99.28312683105469, -10.057873725891113, 9.742474555969238, 502 -39.03501892089844, 75.08192443847656, 12.819415092468262, 503 -33.01505661010742, 38.691341400146484, 66.09259033203125, 504 97.90348052978516, -8.737770080566406, -53.42162322998047, 505 72.1085205078125, -40.423091888427734, -35.68864440917969, 506 -87.64779663085938, 38.874244689941406, 39.383602142333984, 507 7.429088115692139, -76.72171020507812, 50.217063903808594, 508 -52.895477294921875, -44.642333984375, -97.86752319335938, 509 81.73119354248047, 5.428491115570068, -29.22772789001465, 510 72.44898986816406, -59.34124755859375, 39.19960021972656, 511 -65.99439239501953, -4.204323768615723, -60.54586410522461, 512 55.890525817871094, 80.30484008789062, 72.8883056640625, 513 -46.59611129760742, 20.50387954711914, -31.126462936401367, 514 -57.294559478759766, -26.623577117919922, 15.935754776000977, 515 -78.77953338623047, 72.33577728271484 516 ], 517 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 518 } 519 }, 520 'operators': [{ 521 'name': 'maxPool2d', 522 'arguments': [ 523 {'input': 'maxPool2dInput'}, { 524 'options': { 525 'windowDimensions': [3, 3], 526 'padding': [1, 0, 0, 1], 527 'strides': [2, 2], 528 'roundingType': 'floor', 529 'outputSizes': [3, 3] 530 } 531 } 532 ], 533 'outputs': 'maxPool2dOutput' 534 }], 535 'expectedOutputs': { 536 'maxPool2dOutput': { 537 'data': [ 538 99.28312683105469, 9.742474555969238, -39.03501892089844, 539 99.28312683105469, 72.1085205078125, 66.09259033203125, 540 97.90348052978516, 72.1085205078125, 7.429088115692139, 541 81.73119354248047, 72.44898986816406, -59.34124755859375, 542 81.73119354248047, 72.44898986816406, 55.890525817871094, 543 80.30484008789062, 72.33577728271484, 72.33577728271484 544 ], 545 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} 546 } 547 } 548 } 549 }, 550 { 551 'name': 552 'maxPool2d float32 4D tensor options.outputSizes ignores options.roundingType=ceil', 553 'graph': { 554 'inputs': { 555 'maxPool2dInput': { 556 'data': [ 557 89.00830078125, -45.72039031982422, -61.306129455566406, 558 -4.014514446258545, -94.54893493652344, 46.28090286254883, 559 99.28312683105469, -10.057873725891113, 9.742474555969238, 560 -39.03501892089844, 75.08192443847656, 12.819415092468262, 561 -33.01505661010742, 38.691341400146484, 66.09259033203125, 562 97.90348052978516, -8.737770080566406, -53.42162322998047, 563 72.1085205078125, -40.423091888427734, -35.68864440917969, 564 -87.64779663085938, 38.874244689941406, 39.383602142333984, 565 7.429088115692139, -76.72171020507812, 50.217063903808594, 566 -52.895477294921875, -44.642333984375, -97.86752319335938, 567 81.73119354248047, 5.428491115570068, -29.22772789001465, 568 72.44898986816406, -59.34124755859375, 39.19960021972656, 569 -65.99439239501953, -4.204323768615723, -60.54586410522461, 570 55.890525817871094, 80.30484008789062, 72.8883056640625, 571 -46.59611129760742, 20.50387954711914, -31.126462936401367, 572 -57.294559478759766, -26.623577117919922, 15.935754776000977, 573 -78.77953338623047, 72.33577728271484 574 ], 575 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 576 } 577 }, 578 'operators': [{ 579 'name': 'maxPool2d', 580 'arguments': [ 581 {'input': 'maxPool2dInput'}, { 582 'options': { 583 'windowDimensions': [3, 3], 584 'padding': [1, 0, 0, 1], 585 'strides': [2, 2], 586 'roundingType': 'ceil', 587 'outputSizes': [2, 2] 588 } 589 } 590 ], 591 'outputs': 'maxPool2dOutput' 592 }], 593 'expectedOutputs': { 594 'maxPool2dOutput': { 595 'data': [ 596 99.28312683105469, 9.742474555969238, 99.28312683105469, 597 72.1085205078125, 81.73119354248047, 72.44898986816406, 598 81.73119354248047, 72.44898986816406 599 ], 600 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} 601 } 602 } 603 } 604 }, 605 { 606 'name': 607 'maxPool2d float32 4D tensor options.dilations with options.strides', 608 'graph': { 609 'inputs': { 610 'maxPool2dInput': { 611 'data': [ 612 34.69258117675781, -24.706249237060547, -60.428070068359375, 613 35.93883514404297, 60.896095275878906, 79.42220306396484, 614 -77.85906219482422, 54.188209533691406, -21.576934814453125, 615 -49.10390853881836, 78.55176544189453, 74.28213500976562, 616 -87.92769622802734, 79.82047271728516, 11.680922508239746, 617 -12.154505729675293, -22.33293914794922, 33.084861755371094, 618 8.640676498413086, 47.040645599365234, 95.7823486328125, 619 -88.01998138427734, -98.53630065917969, 16.158977508544922, 620 21.396089553833008, 95.1323471069336, -40.80724334716797, 621 -88.70922088623047, -40.772769927978516, 67.89842987060547, 622 -50.337467193603516, -96.56610870361328, 12.508098602294922, 623 -6.6358113288879395, -44.80198287963867, 80.27474212646484, 624 -65.68411254882812, -14.884790420532227, -66.54857635498047, 625 20.072338104248047, -27.954269409179688, -56.62217330932617, 626 82.7479476928711, 93.30175018310547, -34.073394775390625, 627 -22.87164306640625, 73.25525665283203, 41.14021682739258, 628 -19.75514793395996, 80.07701110839844, -69.89276885986328, 629 14.013250350952148, -61.36640167236328, 51.53046417236328, 630 43.53886413574219, -89.5888671875, 51.45121765136719, 631 73.9239730834961, -80.25264739990234, 94.72747802734375, 632 95.25411224365234, 58.12575149536133, 19.885723114013672, 633 -70.0301284790039, 63.419517517089844, -54.11785125732422, 634 -97.22807312011719, -60.65826416015625, -31.04998016357422, 635 -14.646553039550781, -63.73688888549805, 47.34630584716797, 636 85.56405639648438, -53.389251708984375, -70.84739685058594, 637 47.355045318603516, 83.38397979736328, 7.361695289611816, 638 46.85823440551758, 98.13465881347656, -43.9396858215332, 639 50.33780288696289, 37.45563507080078, -54.52760696411133, 640 -6.212307929992676, 34.41734313964844, 11.8167724609375, 641 72.44517517089844, 86.3460922241211, 4.14656925201416, 642 88.33040618896484, 98.29994201660156, -66.72379302978516, 643 58.0643424987793, -51.168277740478516, -17.768583297729492, 644 9.961172103881836, -52.73843002319336 645 ], 646 'descriptor': {shape: [1, 7, 7, 2], dataType: 'float32'} 647 } 648 }, 649 'operators': [{ 650 'name': 'maxPool2d', 651 'arguments': [ 652 {'input': 'maxPool2dInput'}, { 653 'options': { 654 'windowDimensions': [3, 3], 655 'padding': [1, 0, 0, 1], 656 'strides': [2, 2], 657 'dilations': [1, 1], 658 'layout': 'nhwc' 659 } 660 } 661 ], 662 'outputs': 'maxPool2dOutput' 663 }], 664 'expectedOutputs': { 665 'maxPool2dOutput': { 666 'data': [ 667 60.896095275878906, 79.42220306396484, 95.7823486328125, 668 79.42220306396484, 78.55176544189453, 95.1323471069336, 669 82.7479476928711, 93.30175018310547, 95.7823486328125, 670 80.27474212646484, 43.53886413574219, 95.1323471069336, 671 95.25411224365234, 94.72747802734375, 95.25411224365234, 672 98.13465881347656, 63.419517517089844, 98.13465881347656 673 ], 674 'descriptor': {shape: [1, 3, 3, 2], dataType: 'float32'} 675 } 676 } 677 } 678 }, 679 680 // float16 tests 681 { 682 'name': 'maxPool2d float16 4D constant tensor default options', 683 'graph': { 684 'inputs': { 685 'maxPool2dInput': { 686 'data': [ 687 89, -45.71875, -61.3125, -4.015625, -94.5625, 688 46.28125, 99.3125, -10.0546875, 9.7421875, -39.03125, 689 75.0625, 12.8203125, -33, 38.6875, 66.0625, 690 97.875, -8.734375, -53.40625, 72.125, -40.4375, 691 -35.6875, -87.625, 38.875, 39.375, 7.4296875, 692 -76.75, 50.21875, -52.90625, -44.65625, -97.875, 693 81.75, 5.4296875, -29.234375, 72.4375, -59.34375, 694 39.1875, -66, -4.203125, -60.53125, 55.875, 695 80.3125, 72.875, -46.59375, 20.5, -31.125, 696 -57.28125, -26.625, 15.9375, -78.75, 72.3125 697 ], 698 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'}, 699 'constant': true 700 } 701 }, 702 'operators': [{ 703 'name': 'maxPool2d', 704 'arguments': [{'input': 'maxPool2dInput'}], 705 'outputs': 'maxPool2dOutput' 706 }], 707 'expectedOutputs': { 708 'maxPool2dOutput': { 709 'data': [99.3125, 81.75], 710 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float16'} 711 } 712 } 713 } 714 }, 715 { 716 'name': 'maxPool2d float16 4D tensor default options', 717 'graph': { 718 'inputs': { 719 'maxPool2dInput': { 720 'data': [ 721 89, -45.71875, -61.3125, -4.015625, -94.5625, 722 46.28125, 99.3125, -10.0546875, 9.7421875, -39.03125, 723 75.0625, 12.8203125, -33, 38.6875, 66.0625, 724 97.875, -8.734375, -53.40625, 72.125, -40.4375, 725 -35.6875, -87.625, 38.875, 39.375, 7.4296875, 726 -76.75, 50.21875, -52.90625, -44.65625, -97.875, 727 81.75, 5.4296875, -29.234375, 72.4375, -59.34375, 728 39.1875, -66, -4.203125, -60.53125, 55.875, 729 80.3125, 72.875, -46.59375, 20.5, -31.125, 730 -57.28125, -26.625, 15.9375, -78.75, 72.3125 731 ], 732 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 733 } 734 }, 735 'operators': [{ 736 'name': 'maxPool2d', 737 'arguments': [{'input': 'maxPool2dInput'}], 738 'outputs': 'maxPool2dOutput' 739 }], 740 'expectedOutputs': { 741 'maxPool2dOutput': { 742 'data': [99.3125, 81.75], 743 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float16'} 744 } 745 } 746 } 747 }, 748 { 749 'name': 'maxPool2d float16 4D tensor options.windowDimensions', 750 'graph': { 751 'inputs': { 752 'maxPool2dInput': { 753 'data': [ 754 89, -45.71875, -61.3125, -4.015625, -94.5625, 755 46.28125, 99.3125, -10.0546875, 9.7421875, -39.03125, 756 75.0625, 12.8203125, -33, 38.6875, 66.0625, 757 97.875, -8.734375, -53.40625, 72.125, -40.4375, 758 -35.6875, -87.625, 38.875, 39.375, 7.4296875, 759 -76.75, 50.21875, -52.90625, -44.65625, -97.875, 760 81.75, 5.4296875, -29.234375, 72.4375, -59.34375, 761 39.1875, -66, -4.203125, -60.53125, 55.875, 762 80.3125, 72.875, -46.59375, 20.5, -31.125, 763 -57.28125, -26.625, 15.9375, -78.75, 72.3125 764 ], 765 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 766 } 767 }, 768 'operators': [{ 769 'name': 'maxPool2d', 770 'arguments': [ 771 {'input': 'maxPool2dInput'}, {'options': {'windowDimensions': [3, 3]}} 772 ], 773 'outputs': 'maxPool2dOutput' 774 }], 775 'expectedOutputs': { 776 'maxPool2dOutput': { 777 'data': [ 778 99.3125, 99.3125, 66.0625, 99.3125, 99.3125, 72.125, 97.875, 72.125, 779 72.125, 81.75, 72.4375, 72.4375, 81.75, 72.875, 72.4375, 80.3125, 780 72.875, 72.3125 781 ], 782 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float16'} 783 } 784 } 785 } 786 }, 787 { 788 'name': 'maxPool2d float16 4D tensor options.padding', 789 'graph': { 790 'inputs': { 791 'maxPool2dInput': { 792 'data': [ 793 89, -45.71875, -61.3125, -4.015625, -94.5625, 794 46.28125, 99.3125, -10.0546875, 9.7421875, -39.03125, 795 75.0625, 12.8203125, -33, 38.6875, 66.0625, 796 97.875, -8.734375, -53.40625, 72.125, -40.4375, 797 -35.6875, -87.625, 38.875, 39.375, 7.4296875, 798 -76.75, 50.21875, -52.90625, -44.65625, -97.875, 799 81.75, 5.4296875, -29.234375, 72.4375, -59.34375, 800 39.1875, -66, -4.203125, -60.53125, 55.875, 801 80.3125, 72.875, -46.59375, 20.5, -31.125, 802 -57.28125, -26.625, 15.9375, -78.75, 72.3125 803 ], 804 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 805 } 806 }, 807 'operators': [{ 808 'name': 'maxPool2d', 809 'arguments': [ 810 {'input': 'maxPool2dInput'}, {'options': {'padding': [1, 0, 0, 1]}} 811 ], 812 'outputs': 'maxPool2dOutput' 813 }], 814 'expectedOutputs': { 815 'maxPool2dOutput': { 816 'data': [ 817 99.3125, 99.3125, 99.3125, 99.3125, 81.75, 72.875, 81.75, 72.875 818 ], 819 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float16'} 820 } 821 } 822 } 823 }, 824 { 825 'name': 'maxPool2d float16 4D tensor options.strides', 826 'graph': { 827 'inputs': { 828 'maxPool2dInput': { 829 'data': [ 830 89, -45.71875, -61.3125, -4.015625, -94.5625, 831 46.28125, 99.3125, -10.0546875, 9.7421875, -39.03125, 832 75.0625, 12.8203125, -33, 38.6875, 66.0625, 833 97.875, -8.734375, -53.40625, 72.125, -40.4375, 834 -35.6875, -87.625, 38.875, 39.375, 7.4296875, 835 -76.75, 50.21875, -52.90625, -44.65625, -97.875, 836 81.75, 5.4296875, -29.234375, 72.4375, -59.34375, 837 39.1875, -66, -4.203125, -60.53125, 55.875, 838 80.3125, 72.875, -46.59375, 20.5, -31.125, 839 -57.28125, -26.625, 15.9375, -78.75, 72.3125 840 ], 841 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 842 } 843 }, 844 'operators': [{ 845 'name': 'maxPool2d', 846 'arguments': [ 847 {'input': 'maxPool2dInput'}, 848 {'options': {'windowDimensions': [3, 3], 'strides': [2, 2]}} 849 ], 850 'outputs': 'maxPool2dOutput' 851 }], 852 'expectedOutputs': { 853 'maxPool2dOutput': { 854 'data': [ 855 99.3125, 66.0625, 97.875, 72.125, 81.75, 72.4375, 80.3125, 72.3125 856 ], 857 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float16'} 858 } 859 } 860 } 861 }, 862 { 863 'name': 'maxPool2d float16 4D tensor options.dilations', 864 'graph': { 865 'inputs': { 866 'maxPool2dInput': { 867 'data': [ 868 89, -45.71875, -61.3125, -4.015625, -94.5625, 869 46.28125, 99.3125, -10.0546875, 9.7421875, -39.03125, 870 75.0625, 12.8203125, -33, 38.6875, 66.0625, 871 97.875, -8.734375, -53.40625, 72.125, -40.4375, 872 -35.6875, -87.625, 38.875, 39.375, 7.4296875, 873 -76.75, 50.21875, -52.90625, -44.65625, -97.875, 874 81.75, 5.4296875, -29.234375, 72.4375, -59.34375, 875 39.1875, -66, -4.203125, -60.53125, 55.875, 876 80.3125, 72.875, -46.59375, 20.5, -31.125, 877 -57.28125, -26.625, 15.9375, -78.75, 72.3125 878 ], 879 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 880 } 881 }, 882 'operators': [{ 883 'name': 'maxPool2d', 884 'arguments': [ 885 {'input': 'maxPool2dInput'}, 886 {'options': {'windowDimensions': [3, 3], 'dilations': [2, 2]}} 887 ], 888 'outputs': 'maxPool2dOutput' 889 }], 890 'expectedOutputs': { 891 'maxPool2dOutput': { 892 'data': [89, 72.3125], 893 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float16'} 894 } 895 } 896 } 897 }, 898 { 899 'name': 'maxPool2d float16 4D tensor options.layout=nchw', 900 'graph': { 901 'inputs': { 902 'maxPool2dInput': { 903 'data': [ 904 89, -45.71875, -61.3125, -4.015625, -94.5625, 905 46.28125, 99.3125, -10.0546875, 9.7421875, -39.03125, 906 75.0625, 12.8203125, -33, 38.6875, 66.0625, 907 97.875, -8.734375, -53.40625, 72.125, -40.4375, 908 -35.6875, -87.625, 38.875, 39.375, 7.4296875, 909 -76.75, 50.21875, -52.90625, -44.65625, -97.875, 910 81.75, 5.4296875, -29.234375, 72.4375, -59.34375, 911 39.1875, -66, -4.203125, -60.53125, 55.875, 912 80.3125, 72.875, -46.59375, 20.5, -31.125, 913 -57.28125, -26.625, 15.9375, -78.75, 72.3125 914 ], 915 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 916 } 917 }, 918 'operators': [{ 919 'name': 'maxPool2d', 920 'arguments': 921 [{'input': 'maxPool2dInput'}, {'options': {'layout': 'nchw'}}], 922 'outputs': 'maxPool2dOutput' 923 }], 924 'expectedOutputs': { 925 'maxPool2dOutput': { 926 'data': [99.3125, 81.75], 927 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float16'} 928 } 929 } 930 } 931 }, 932 { 933 'name': 'maxPool2d float16 4D tensor options.layout=nhwc', 934 'graph': { 935 'inputs': { 936 'maxPool2dInput': { 937 'data': [ 938 89, -76.75, -45.71875, 50.21875, -61.3125, 939 -52.90625, -4.015625, -44.65625, -94.5625, -97.875, 940 46.28125, 81.75, 99.3125, 5.4296875, -10.0546875, 941 -29.234375, 9.7421875, 72.4375, -39.03125, -59.34375, 942 75.0625, 39.1875, 12.8203125, -66, -33, 943 -4.203125, 38.6875, -60.53125, 66.0625, 55.875, 944 97.875, 80.3125, -8.734375, 72.875, -53.40625, 945 -46.59375, 72.125, 20.5, -40.4375, -31.125, 946 -35.6875, -57.28125, -87.625, -26.625, 38.875, 947 15.9375, 39.375, -78.75, 7.4296875, 72.3125 948 ], 949 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float16'} 950 } 951 }, 952 'operators': [{ 953 'name': 'maxPool2d', 954 'arguments': 955 [{'input': 'maxPool2dInput'}, {'options': {'layout': 'nhwc'}}], 956 'outputs': 'maxPool2dOutput' 957 }], 958 'expectedOutputs': { 959 'maxPool2dOutput': { 960 'data': [99.3125, 81.75], 961 'descriptor': {shape: [1, 1, 1, 2], dataType: 'float16'} 962 } 963 } 964 } 965 }, 966 { 967 'name': 'maxPool2d float16 4D tensor options.roundingType=floor', 968 'graph': { 969 'inputs': { 970 'maxPool2dInput': { 971 'data': [ 972 89, -45.71875, -61.3125, -4.015625, -94.5625, 973 46.28125, 99.3125, -10.0546875, 9.7421875, -39.03125, 974 75.0625, 12.8203125, -33, 38.6875, 66.0625, 975 97.875, -8.734375, -53.40625, 72.125, -40.4375, 976 -35.6875, -87.625, 38.875, 39.375, 7.4296875, 977 -76.75, 50.21875, -52.90625, -44.65625, -97.875, 978 81.75, 5.4296875, -29.234375, 72.4375, -59.34375, 979 39.1875, -66, -4.203125, -60.53125, 55.875, 980 80.3125, 72.875, -46.59375, 20.5, -31.125, 981 -57.28125, -26.625, 15.9375, -78.75, 72.3125 982 ], 983 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 984 } 985 }, 986 'operators': [{ 987 'name': 'maxPool2d', 988 'arguments': [ 989 {'input': 'maxPool2dInput'}, { 990 'options': { 991 'windowDimensions': [3, 3], 992 'padding': [1, 0, 0, 1], 993 'strides': [2, 2], 994 'roundingType': 'floor' 995 } 996 } 997 ], 998 'outputs': 'maxPool2dOutput' 999 }], 1000 'expectedOutputs': { 1001 'maxPool2dOutput': { 1002 'data': [ 1003 99.3125, 9.7421875, 99.3125, 72.125, 81.75, 72.4375, 81.75, 72.4375 1004 ], 1005 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float16'} 1006 } 1007 } 1008 } 1009 }, 1010 { 1011 'name': 'maxPool2d float16 4D tensor options.roundingType=ceil', 1012 'graph': { 1013 'inputs': { 1014 'maxPool2dInput': { 1015 'data': [ 1016 89, -45.71875, -61.3125, -4.015625, -94.5625, 1017 46.28125, 99.3125, -10.0546875, 9.7421875, -39.03125, 1018 75.0625, 12.8203125, -33, 38.6875, 66.0625, 1019 97.875, -8.734375, -53.40625, 72.125, -40.4375, 1020 -35.6875, -87.625, 38.875, 39.375, 7.4296875, 1021 -76.75, 50.21875, -52.90625, -44.65625, -97.875, 1022 81.75, 5.4296875, -29.234375, 72.4375, -59.34375, 1023 39.1875, -66, -4.203125, -60.53125, 55.875, 1024 80.3125, 72.875, -46.59375, 20.5, -31.125, 1025 -57.28125, -26.625, 15.9375, -78.75, 72.3125 1026 ], 1027 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 1028 } 1029 }, 1030 'operators': [{ 1031 'name': 'maxPool2d', 1032 'arguments': [ 1033 {'input': 'maxPool2dInput'}, { 1034 'options': { 1035 'windowDimensions': [3, 3], 1036 'padding': [1, 0, 0, 1], 1037 'strides': [2, 2], 1038 'roundingType': 'ceil' 1039 } 1040 } 1041 ], 1042 'outputs': 'maxPool2dOutput' 1043 }], 1044 'expectedOutputs': { 1045 'maxPool2dOutput': { 1046 'data': [ 1047 99.3125, 9.7421875, -39.03125, 99.3125, 72.125, 66.0625, 97.875, 1048 72.125, 7.4296875, 81.75, 72.4375, -59.34375, 81.75, 72.4375, 1049 55.875, 80.3125, 72.3125, 72.3125 1050 ], 1051 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float16'} 1052 } 1053 } 1054 } 1055 }, 1056 { 1057 'name': 1058 'maxPool2d float16 4D tensor options.outputSizes ignores options.roundingType=floor', 1059 'graph': { 1060 'inputs': { 1061 'maxPool2dInput': { 1062 'data': [ 1063 89, -45.71875, -61.3125, -4.015625, -94.5625, 1064 46.28125, 99.3125, -10.0546875, 9.7421875, -39.03125, 1065 75.0625, 12.8203125, -33, 38.6875, 66.0625, 1066 97.875, -8.734375, -53.40625, 72.125, -40.4375, 1067 -35.6875, -87.625, 38.875, 39.375, 7.4296875, 1068 -76.75, 50.21875, -52.90625, -44.65625, -97.875, 1069 81.75, 5.4296875, -29.234375, 72.4375, -59.34375, 1070 39.1875, -66, -4.203125, -60.53125, 55.875, 1071 80.3125, 72.875, -46.59375, 20.5, -31.125, 1072 -57.28125, -26.625, 15.9375, -78.75, 72.3125 1073 ], 1074 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 1075 } 1076 }, 1077 'operators': [{ 1078 'name': 'maxPool2d', 1079 'arguments': [ 1080 {'input': 'maxPool2dInput'}, { 1081 'options': { 1082 'windowDimensions': [3, 3], 1083 'padding': [1, 0, 0, 1], 1084 'strides': [2, 2], 1085 'roundingType': 'floor', 1086 'outputSizes': [3, 3] 1087 } 1088 } 1089 ], 1090 'outputs': 'maxPool2dOutput' 1091 }], 1092 'expectedOutputs': { 1093 'maxPool2dOutput': { 1094 'data': [ 1095 99.3125, 9.7421875, -39.03125, 99.3125, 72.125, 66.0625, 97.875, 1096 72.125, 7.4296875, 81.75, 72.4375, -59.34375, 81.75, 72.4375, 1097 55.875, 80.3125, 72.3125, 72.3125 1098 ], 1099 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float16'} 1100 } 1101 } 1102 } 1103 }, 1104 { 1105 'name': 1106 'maxPool2d float16 4D tensor options.outputSizes ignores options.roundingType=ceil', 1107 'graph': { 1108 'inputs': { 1109 'maxPool2dInput': { 1110 'data': [ 1111 89, -45.71875, -61.3125, -4.015625, -94.5625, 1112 46.28125, 99.3125, -10.0546875, 9.7421875, -39.03125, 1113 75.0625, 12.8203125, -33, 38.6875, 66.0625, 1114 97.875, -8.734375, -53.40625, 72.125, -40.4375, 1115 -35.6875, -87.625, 38.875, 39.375, 7.4296875, 1116 -76.75, 50.21875, -52.90625, -44.65625, -97.875, 1117 81.75, 5.4296875, -29.234375, 72.4375, -59.34375, 1118 39.1875, -66, -4.203125, -60.53125, 55.875, 1119 80.3125, 72.875, -46.59375, 20.5, -31.125, 1120 -57.28125, -26.625, 15.9375, -78.75, 72.3125 1121 ], 1122 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 1123 } 1124 }, 1125 'operators': [{ 1126 'name': 'maxPool2d', 1127 'arguments': [ 1128 {'input': 'maxPool2dInput'}, { 1129 'options': { 1130 'windowDimensions': [3, 3], 1131 'padding': [1, 0, 0, 1], 1132 'strides': [2, 2], 1133 'roundingType': 'ceil', 1134 'outputSizes': [2, 2] 1135 } 1136 } 1137 ], 1138 'outputs': 'maxPool2dOutput' 1139 }], 1140 'expectedOutputs': { 1141 'maxPool2dOutput': { 1142 'data': [ 1143 99.3125, 9.7421875, 99.3125, 72.125, 81.75, 72.4375, 81.75, 72.4375 1144 ], 1145 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float16'} 1146 } 1147 } 1148 } 1149 }, 1150 { 1151 'name': 1152 'maxPool2d float16 4D tensor options.dilations with options.strides', 1153 'graph': { 1154 'inputs': { 1155 'maxPool2dInput': { 1156 'data': [ 1157 34.6875, -24.703125, -60.4375, 35.9375, 60.90625, 1158 79.4375, -77.875, 54.1875, -21.578125, -49.09375, 1159 78.5625, 74.3125, -87.9375, 79.8125, 11.6796875, 1160 -12.15625, -22.328125, 33.09375, 8.640625, 47.03125, 1161 95.8125, -88, -98.5625, 16.15625, 21.390625, 1162 95.125, -40.8125, -88.6875, -40.78125, 67.875, 1163 -50.34375, -96.5625, 12.5078125, -6.63671875, -44.8125, 1164 80.25, -65.6875, -14.8828125, -66.5625, 20.078125, 1165 -27.953125, -56.625, 82.75, 93.3125, -34.0625, 1166 -22.875, 73.25, 41.125, -19.75, 80.0625, 1167 -69.875, 14.015625, -61.375, 51.53125, 43.53125, 1168 -89.5625, 51.4375, 73.9375, -80.25, 94.75, 1169 95.25, 58.125, 19.890625, -70, 63.40625, 1170 -54.125, -97.25, -60.65625, -31.046875, -14.6484375, 1171 -63.75, 47.34375, 85.5625, -53.375, -70.875, 1172 47.34375, 83.375, 7.36328125, 46.84375, 98.125, 1173 -43.9375, 50.34375, 37.46875, -54.53125, -6.2109375, 1174 34.40625, 11.8203125, 72.4375, 86.375, 4.1484375, 1175 88.3125, 98.3125, -66.75, 58.0625, -51.15625, 1176 -17.765625, 9.9609375, -52.75 1177 ], 1178 'descriptor': {shape: [1, 7, 7, 2], dataType: 'float16'} 1179 } 1180 }, 1181 'operators': [{ 1182 'name': 'maxPool2d', 1183 'arguments': [ 1184 {'input': 'maxPool2dInput'}, { 1185 'options': { 1186 'windowDimensions': [3, 3], 1187 'padding': [1, 0, 0, 1], 1188 'strides': [2, 2], 1189 'dilations': [1, 1], 1190 'layout': 'nhwc' 1191 } 1192 } 1193 ], 1194 'outputs': 'maxPool2dOutput' 1195 }], 1196 'expectedOutputs': { 1197 'maxPool2dOutput': { 1198 'data': [ 1199 60.90625, 79.4375, 95.8125, 79.4375, 78.5625, 95.125, 82.75, 1200 93.3125, 95.8125, 80.25, 43.53125, 95.125, 95.25, 94.75, 95.25, 1201 98.125, 63.40625, 98.125 1202 ], 1203 'descriptor': {shape: [1, 3, 3, 2], dataType: 'float16'} 1204 } 1205 } 1206 } 1207 } 1208 ]; 1209 1210 webnn_conformance_test( 1211 maxPool2dTests, buildAndExecuteGraph, getPrecisionTolerance);