conv2d.https.any.js (85085B)
1 // META: title=test WebNN API conv2d 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-conv2d 12 // Compute a 2-D convolution given 4-D input and filter tensors. 13 // 14 // enum MLConv2dFilterOperandLayout { 15 // "oihw", 16 // "hwio", 17 // "ohwi", 18 // "ihwo" 19 // }; 20 // 21 // dictionary MLConv2dOptions { 22 // sequence<[EnforceRange] unsigned long> padding; 23 // sequence<[EnforceRange] unsigned long> strides; 24 // sequence<[EnforceRange] unsigned long> dilations; 25 // [EnforceRange] unsigned long groups = 1; 26 // MLInputOperandLayout inputLayout = "nchw"; 27 // MLConv2dFilterOperandLayout filterLayout = "oihw"; 28 // MLOperand bias; 29 // }; 30 // 31 // MLOperand conv2d( 32 // MLOperand input, MLOperand filter, 33 // optional MLConv2dOptions options = {}); 34 35 36 const conv2dTests = [ 37 { 38 'name': 39 'conv2d float32 4D both input and filter non-constant tensors default options', 40 'graph': { 41 'inputs': { 42 'conv2dInput': { 43 'data': [ 44 0.6124474406242371, 0.8857858777046204, 0.13667134940624237, 45 0.5645291209220886, 0.8965172171592712, 0.36792829632759094, 46 0.6811466217041016, 0.0479511022567749, 0.33355462551116943, 47 0.19882695376873016, 0.41167140007019043, 0.07934240251779556, 48 0.4272463321685791, 0.535800576210022, 0.5910806059837341, 49 0.28415432572364807, 0.4147258698940277, 0.026906268671154976, 50 0.3621256649494171, 0.9945681691169739, 0.07184549421072006, 51 0.12204372137784958, 0.8422137498855591, 0.4537501037120819, 52 0.21529443562030792 53 ], 54 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} 55 }, 56 'conv2dFilter': { 57 'data': [ 58 0.3804761469364166, 0.5280312299728394, 0.21947036683559418, 59 0.36689770221710205, 0.33974137902259827, 0.4200059771537781, 60 0.3805030882358551, 0.19443586468696594, 0.5686976909637451 61 ], 62 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} 63 } 64 }, 65 'operators': [{ 66 'name': 'conv2d', 67 'arguments': [{'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}], 68 'outputs': 'conv2dOutput' 69 }], 70 'expectedOutputs': { 71 'conv2dOutput': { 72 'data': [ 73 1.5323282480239868, 1.3573521375656128, 1.3641656637191772, 74 1.071682333946228, 1.1259644031524658, 1.4713115692138672, 75 1.078782320022583, 1.155018925666809, 1.656954288482666 76 ], 77 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} 78 } 79 } 80 } 81 }, 82 { 83 'name': 84 'conv2d float32 4D both input and filter constant tensors default options', 85 'graph': { 86 'inputs': { 87 'conv2dInput': { 88 'data': [ 89 0.6124474406242371, 0.8857858777046204, 0.13667134940624237, 90 0.5645291209220886, 0.8965172171592712, 0.36792829632759094, 91 0.6811466217041016, 0.0479511022567749, 0.33355462551116943, 92 0.19882695376873016, 0.41167140007019043, 0.07934240251779556, 93 0.4272463321685791, 0.535800576210022, 0.5910806059837341, 94 0.28415432572364807, 0.4147258698940277, 0.026906268671154976, 95 0.3621256649494171, 0.9945681691169739, 0.07184549421072006, 96 0.12204372137784958, 0.8422137498855591, 0.4537501037120819, 97 0.21529443562030792 98 ], 99 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'}, 100 'constant': true 101 }, 102 'conv2dFilter': { 103 'data': [ 104 0.3804761469364166, 0.5280312299728394, 0.21947036683559418, 105 0.36689770221710205, 0.33974137902259827, 0.4200059771537781, 106 0.3805030882358551, 0.19443586468696594, 0.5686976909637451 107 ], 108 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'}, 109 'constant': true 110 } 111 }, 112 'operators': [{ 113 'name': 'conv2d', 114 'arguments': [{'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}], 115 'outputs': 'conv2dOutput' 116 }], 117 'expectedOutputs': { 118 'conv2dOutput': { 119 'data': [ 120 1.5323282480239868, 1.3573521375656128, 1.3641656637191772, 121 1.071682333946228, 1.1259644031524658, 1.4713115692138672, 122 1.078782320022583, 1.155018925666809, 1.656954288482666 123 ], 124 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} 125 } 126 } 127 } 128 }, 129 { 130 'name': 'conv2d float32 4D input and filter tensors default options', 131 'graph': { 132 'inputs': { 133 'conv2dInput': { 134 'data': [ 135 0.6124474406242371, 0.8857858777046204, 0.13667134940624237, 136 0.5645291209220886, 0.8965172171592712, 0.36792829632759094, 137 0.6811466217041016, 0.0479511022567749, 0.33355462551116943, 138 0.19882695376873016, 0.41167140007019043, 0.07934240251779556, 139 0.4272463321685791, 0.535800576210022, 0.5910806059837341, 140 0.28415432572364807, 0.4147258698940277, 0.026906268671154976, 141 0.3621256649494171, 0.9945681691169739, 0.07184549421072006, 142 0.12204372137784958, 0.8422137498855591, 0.4537501037120819, 143 0.21529443562030792 144 ], 145 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} 146 }, 147 'conv2dFilter': { 148 'data': [ 149 0.3804761469364166, 0.5280312299728394, 0.21947036683559418, 150 0.36689770221710205, 0.33974137902259827, 0.4200059771537781, 151 0.3805030882358551, 0.19443586468696594, 0.5686976909637451 152 ], 153 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'}, 154 'constant': true 155 } 156 }, 157 'operators': [{ 158 'name': 'conv2d', 159 'arguments': [{'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}], 160 'outputs': 'conv2dOutput' 161 }], 162 'expectedOutputs': { 163 'conv2dOutput': { 164 'data': [ 165 1.5323282480239868, 1.3573521375656128, 1.3641656637191772, 166 1.071682333946228, 1.1259644031524658, 1.4713115692138672, 167 1.078782320022583, 1.155018925666809, 1.656954288482666 168 ], 169 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} 170 } 171 } 172 } 173 }, 174 { 175 'name': 'conv2d float32 4D input and filter tensors options.padding', 176 'graph': { 177 'inputs': { 178 'conv2dInput': { 179 'data': [ 180 0.6124474406242371, 0.8857858777046204, 0.13667134940624237, 181 0.5645291209220886, 0.8965172171592712, 0.36792829632759094, 182 0.6811466217041016, 0.0479511022567749, 0.33355462551116943, 183 0.19882695376873016, 0.41167140007019043, 0.07934240251779556, 184 0.4272463321685791, 0.535800576210022, 0.5910806059837341, 185 0.28415432572364807, 0.4147258698940277, 0.026906268671154976, 186 0.3621256649494171, 0.9945681691169739, 0.07184549421072006, 187 0.12204372137784958, 0.8422137498855591, 0.4537501037120819, 188 0.21529443562030792 189 ], 190 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} 191 }, 192 'conv2dFilter': { 193 'data': [ 194 0.3804761469364166, 0.5280312299728394, 0.21947036683559418, 195 0.36689770221710205, 0.33974137902259827, 0.4200059771537781, 196 0.3805030882358551, 0.19443586468696594, 0.5686976909637451 197 ], 198 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'}, 199 'constant': true 200 } 201 }, 202 'operators': [{ 203 'name': 'conv2d', 204 'arguments': [ 205 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 206 {'options': {'padding': [1, 1, 1, 1]}} 207 ], 208 'outputs': 'conv2dOutput' 209 }], 210 'expectedOutputs': { 211 'conv2dOutput': { 212 'data': [ 213 1.0390141010284424, 0.882753312587738, 1.0667248964309692, 214 0.8146538734436035, 0.6772860884666443, 1.0540467500686646, 215 1.5323282480239868, 1.3573521375656128, 1.3641656637191772, 216 1.1969101428985596, 0.8080586791038513, 1.071682333946228, 217 1.1259644031524658, 1.4713115692138672, 0.960464596748352, 218 0.5888903141021729, 1.078782320022583, 1.155018925666809, 219 1.656954288482666, 1.2012416124343872, 0.3167303800582886, 220 0.7545653581619263, 0.7729666829109192, 0.9733180403709412, 221 0.9025675058364868 222 ], 223 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} 224 } 225 } 226 } 227 }, 228 { 229 'name': 'conv2d float32 4D input and filter tensors options.strides', 230 'graph': { 231 'inputs': { 232 'conv2dInput': { 233 'data': [ 234 0.6124474406242371, 0.8857858777046204, 0.13667134940624237, 235 0.5645291209220886, 0.8965172171592712, 0.36792829632759094, 236 0.6811466217041016, 0.0479511022567749, 0.33355462551116943, 237 0.19882695376873016, 0.41167140007019043, 0.07934240251779556, 238 0.4272463321685791, 0.535800576210022, 0.5910806059837341, 239 0.28415432572364807, 0.4147258698940277, 0.026906268671154976, 240 0.3621256649494171, 0.9945681691169739, 0.07184549421072006, 241 0.12204372137784958, 0.8422137498855591, 0.4537501037120819, 242 0.21529443562030792 243 ], 244 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} 245 }, 246 'conv2dFilter': { 247 'data': [ 248 0.3804761469364166, 0.5280312299728394, 0.21947036683559418, 249 0.36689770221710205, 0.33974137902259827, 0.4200059771537781, 250 0.3805030882358551, 0.19443586468696594, 0.5686976909637451 251 ], 252 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'}, 253 'constant': true 254 } 255 }, 256 'operators': [{ 257 'name': 'conv2d', 258 'arguments': [ 259 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 260 {'options': {'strides': [2, 2]}} 261 ], 262 'outputs': 'conv2dOutput' 263 }], 264 'expectedOutputs': { 265 'conv2dOutput': { 266 'data': [ 267 1.5323282480239868, 1.3641656637191772, 1.078782320022583, 268 1.656954288482666 269 ], 270 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'} 271 } 272 } 273 } 274 }, 275 { 276 'name': 'conv2d float32 4D input and filter tensors options.dilations', 277 'graph': { 278 'inputs': { 279 'conv2dInput': { 280 'data': [ 281 0.6124474406242371, 0.8857858777046204, 0.13667134940624237, 282 0.5645291209220886, 0.8965172171592712, 0.36792829632759094, 283 0.6811466217041016, 0.0479511022567749, 0.33355462551116943, 284 0.19882695376873016, 0.41167140007019043, 0.07934240251779556, 285 0.4272463321685791, 0.535800576210022, 0.5910806059837341, 286 0.28415432572364807, 0.4147258698940277, 0.026906268671154976, 287 0.3621256649494171, 0.9945681691169739, 0.07184549421072006, 288 0.12204372137784958, 0.8422137498855591, 0.4537501037120819, 289 0.21529443562030792 290 ], 291 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} 292 }, 293 'conv2dFilter': { 294 'data': [ 295 0.3804761469364166, 0.5280312299728394, 0.21947036683559418, 296 0.36689770221710205, 0.33974137902259827, 0.4200059771537781, 297 0.3805030882358551, 0.19443586468696594, 0.5686976909637451 298 ], 299 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'}, 300 'constant': true 301 } 302 }, 303 'operators': [{ 304 'name': 'conv2d', 305 'arguments': [ 306 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 307 {'options': {'dilations': [2, 2]}} 308 ], 309 'outputs': 'conv2dOutput' 310 }], 311 'expectedOutputs': { 312 'conv2dOutput': { 313 'data': [1.3599307537078857], 314 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} 315 } 316 } 317 } 318 }, 319 { 320 'name': 321 'depthwise conv2d float32 4D input and filter tensors options.groups= input_channels', 322 'graph': { 323 'inputs': { 324 'conv2dInput': { 325 'data': [ 326 0.8444867730140686, 0.9432409405708313, 0.6556113362312317, 327 0.6982811689376831, 0.9994443655014038, 0.23663610219955444, 328 0.36740678548812866, 0.2619246542453766, 0.6254158616065979, 329 0.8403863906860352, 0.3783077001571655, 0.4543924033641815, 330 0.25327208638191223, 0.5780375599861145, 0.5414554476737976, 331 0.37846308946609497 332 ], 333 'descriptor': {shape: [1, 4, 2, 2], dataType: 'float32'} 334 }, 335 'conv2dFilter': { 336 'data': [ 337 0.27221617102622986, 0.281202495098114, 0.854483962059021, 338 0.1796930730342865, 0.7762278318405151, 0.5140685439109802, 339 0.6374202966690063, 0.12801742553710938, 0.8373776078224182, 340 0.5726001858711243, 0.09855203330516815, 0.5929878950119019, 341 0.5900803804397583, 0.9690897464752197, 0.23175589740276337, 342 0.14805112779140472 343 ], 344 'descriptor': {shape: [4, 1, 2, 2], dataType: 'float32'}, 345 'constant': true 346 } 347 }, 348 'operators': [{ 349 'name': 'conv2d', 350 'arguments': [ 351 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 352 {'options': {'groups': 4}} 353 ], 354 'outputs': 'conv2dOutput' 355 }], 356 'expectedOutputs': { 357 'conv2dOutput': { 358 'data': [ 359 1.1808103322982788, 1.165167212486267, 1.311646819114685, 360 0.8911385536193848 361 ], 362 'descriptor': {shape: [1, 4, 1, 1], dataType: 'float32'} 363 } 364 } 365 } 366 }, 367 { 368 'name': 369 'conv2d float32 4D input and filter tensors options.inputLayout=\'nchw\'', 370 'graph': { 371 'inputs': { 372 'conv2dInput': { 373 'data': [ 374 0.7529087066650391, 0.7520291805267334, 0.5949527621269226, 375 0.2163185328245163, 0.07589349150657654, 0.151067852973938, 376 0.1212485060095787, 0.5364335179328918, 0.5937089920043945, 377 0.991003155708313, 0.3630942404270172, 0.9289674162864685, 378 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 379 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 380 ], 381 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float32'} 382 }, 383 'conv2dFilter': { 384 'data': [ 385 0.14543837308883667, 0.9671129584312439, 0.10836050659418106, 386 0.3202308118343353, 0.6952692270278931, 0.5070913434028625, 387 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 388 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 389 ], 390 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float32'}, 391 'constant': true 392 } 393 }, 394 'operators': [{ 395 'name': 'conv2d', 396 'arguments': [ 397 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 398 {'options': {'inputLayout': 'nchw'}} 399 ], 400 'outputs': 'conv2dOutput' 401 }], 402 'expectedOutputs': { 403 'conv2dOutput': { 404 'data': [ 405 0.8845428228378296, 0.7413608431816101, 0.2897796928882599, 406 0.4053896367549896, 0.9626783132553101, 0.9108520746231079, 407 0.4832426905632019, 0.4878997206687927, 0.8020333051681519, 408 0.6277193427085876, 0.4483422338962555, 0.8711439371109009, 409 0.6932874917984009, 1.0369365215301514, 0.8282973766326904, 410 0.35335418581962585, 1.1787647008895874, 0.8123774528503418, 411 0.816078782081604, 0.6780439019203186, 0.9170808792114258, 412 1.082636833190918, 1.2353861331939697, 0.9810346961021423 413 ], 414 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} 415 } 416 } 417 } 418 }, 419 { 420 'name': 421 'conv2d float32 4D input and filter tensors options.inputLayout=\'nhwc\'', 422 'graph': { 423 'inputs': { 424 'conv2dInput': { 425 'data': [ 426 0.7529087066650391, 0.7520291805267334, 0.5949527621269226, 427 0.2163185328245163, 0.07589349150657654, 0.151067852973938, 428 0.1212485060095787, 0.5364335179328918, 0.5937089920043945, 429 0.991003155708313, 0.3630942404270172, 0.9289674162864685, 430 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 431 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 432 ], 433 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'} 434 }, 435 'conv2dFilter': { 436 'data': [ 437 0.14543837308883667, 0.9671129584312439, 0.10836050659418106, 438 0.3202308118343353, 0.6952692270278931, 0.5070913434028625, 439 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 440 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 441 ], 442 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float32'}, 443 'constant': true 444 } 445 }, 446 'operators': [{ 447 'name': 'conv2d', 448 'arguments': [ 449 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 450 {'options': {'inputLayout': 'nhwc'}} 451 ], 452 'outputs': 'conv2dOutput' 453 }], 454 'expectedOutputs': { 455 'conv2dOutput': { 456 'data': [ 457 0.8845428228378296, 0.9626783132553101, 0.8020333051681519, 458 0.7413608431816101, 0.9108520746231079, 0.6277193427085876, 459 0.2897796928882599, 0.4832426905632019, 0.4483422338962555, 460 0.4053896367549896, 0.4878997206687927, 0.8711439371109009, 461 0.6932874917984009, 1.1787647008895874, 0.9170808792114258, 462 1.0369365215301514, 0.8123774528503418, 1.082636833190918, 463 0.8282973766326904, 0.816078782081604, 1.2353861331939697, 464 0.35335418581962585, 0.6780439019203186, 0.9810346961021423 465 ], 466 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} 467 } 468 } 469 } 470 }, 471 { 472 'name': 473 'conv2d float32 4D input and filter tensors options.filterLayout=\'oihw\'', 474 'graph': { 475 'inputs': { 476 'conv2dInput': { 477 'data': [ 478 0.7529087066650391, 0.7520291805267334, 0.5949527621269226, 479 0.2163185328245163, 0.07589349150657654, 0.151067852973938, 480 0.1212485060095787, 0.5364335179328918, 0.5937089920043945, 481 0.991003155708313, 0.3630942404270172, 0.9289674162864685, 482 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 483 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 484 ], 485 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float32'} 486 }, 487 'conv2dFilter': { 488 'data': [ 489 0.14543837308883667, 0.9671129584312439, 0.10836050659418106, 490 0.3202308118343353, 0.6952692270278931, 0.5070913434028625, 491 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 492 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 493 ], 494 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float32'}, 495 'constant': true 496 } 497 }, 498 'operators': [{ 499 'name': 'conv2d', 500 'arguments': [ 501 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 502 {'options': {'filterLayout': 'oihw'}} 503 ], 504 'outputs': 'conv2dOutput' 505 }], 506 'expectedOutputs': { 507 'conv2dOutput': { 508 'data': [ 509 0.8845428228378296, 0.7413608431816101, 0.2897796928882599, 510 0.4053896367549896, 0.9626783132553101, 0.9108520746231079, 511 0.4832426905632019, 0.4878997206687927, 0.8020333051681519, 512 0.6277193427085876, 0.4483422338962555, 0.8711439371109009, 513 0.6932874917984009, 1.0369365215301514, 0.8282973766326904, 514 0.35335418581962585, 1.1787647008895874, 0.8123774528503418, 515 0.816078782081604, 0.6780439019203186, 0.9170808792114258, 516 1.082636833190918, 1.2353861331939697, 0.9810346961021423 517 ], 518 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} 519 } 520 } 521 } 522 }, 523 { 524 'name': 525 'conv2d float32 4D input and filter tensors options.filterLayout=\'hwio\'', 526 'graph': { 527 'inputs': { 528 'conv2dInput': { 529 'data': [ 530 0.7529087066650391, 0.7520291805267334, 0.5949527621269226, 531 0.2163185328245163, 0.07589349150657654, 0.151067852973938, 532 0.1212485060095787, 0.5364335179328918, 0.5937089920043945, 533 0.991003155708313, 0.3630942404270172, 0.9289674162864685, 534 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 535 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 536 ], 537 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float32'} 538 }, 539 'conv2dFilter': { 540 'data': [ 541 0.14543837308883667, 0.6952692270278931, 0.3072136342525482, 542 0.9671129584312439, 0.5070913434028625, 0.43241235613822937, 543 0.10836050659418106, 0.08139707148075104, 0.9849002361297607, 544 0.3202308118343353, 0.5303338766098022, 0.4281076192855835 545 ], 546 'descriptor': {shape: [2, 2, 1, 3], dataType: 'float32'}, 547 'constant': true 548 } 549 }, 550 'operators': [{ 551 'name': 'conv2d', 552 'arguments': [ 553 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 554 {'options': {'filterLayout': 'hwio'}} 555 ], 556 'outputs': 'conv2dOutput' 557 }], 558 'expectedOutputs': { 559 'conv2dOutput': { 560 'data': [ 561 0.8845428228378296, 0.7413608431816101, 0.2897796928882599, 562 0.4053896367549896, 0.9626783132553101, 0.9108520746231079, 563 0.4832426905632019, 0.4878997206687927, 0.8020333051681519, 564 0.6277193427085876, 0.4483422338962555, 0.8711439371109009, 565 0.6932874917984009, 1.0369365215301514, 0.8282973766326904, 566 0.35335418581962585, 1.1787647008895874, 0.8123774528503418, 567 0.816078782081604, 0.6780439019203186, 0.9170808792114258, 568 1.082636833190918, 1.2353861331939697, 0.9810346961021423 569 ], 570 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} 571 } 572 } 573 } 574 }, 575 { 576 'name': 577 'conv2d float32 4D input and filter tensors options.filterLayout=\'ohwi\'', 578 'graph': { 579 'inputs': { 580 'conv2dInput': { 581 'data': [ 582 0.7529087066650391, 0.7520291805267334, 0.5949527621269226, 583 0.2163185328245163, 0.07589349150657654, 0.151067852973938, 584 0.1212485060095787, 0.5364335179328918, 0.5937089920043945, 585 0.991003155708313, 0.3630942404270172, 0.9289674162864685, 586 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 587 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 588 ], 589 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float32'} 590 }, 591 'conv2dFilter': { 592 'data': [ 593 0.14543837308883667, 0.9671129584312439, 0.10836050659418106, 594 0.3202308118343353, 0.6952692270278931, 0.5070913434028625, 595 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 596 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 597 ], 598 'descriptor': {shape: [3, 2, 2, 1], dataType: 'float32'}, 599 'constant': true 600 } 601 }, 602 'operators': [{ 603 'name': 'conv2d', 604 'arguments': [ 605 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 606 {'options': {'filterLayout': 'ohwi'}} 607 ], 608 'outputs': 'conv2dOutput' 609 }], 610 'expectedOutputs': { 611 'conv2dOutput': { 612 'data': [ 613 0.8845428228378296, 0.7413608431816101, 0.2897796928882599, 614 0.4053896367549896, 0.9626783132553101, 0.9108520746231079, 615 0.4832426905632019, 0.4878997206687927, 0.8020333051681519, 616 0.6277193427085876, 0.4483422338962555, 0.8711439371109009, 617 0.6932874917984009, 1.0369365215301514, 0.8282973766326904, 618 0.35335418581962585, 1.1787647008895874, 0.8123774528503418, 619 0.816078782081604, 0.6780439019203186, 0.9170808792114258, 620 1.082636833190918, 1.2353861331939697, 0.9810346961021423 621 ], 622 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} 623 } 624 } 625 } 626 }, 627 { 628 'name': 629 'conv2d float32 4D input and filter tensors options.filterLayout=\'ihwo\'', 630 'graph': { 631 'inputs': { 632 'conv2dInput': { 633 'data': [ 634 0.7529087066650391, 0.7520291805267334, 0.5949527621269226, 635 0.2163185328245163, 0.07589349150657654, 0.151067852973938, 636 0.1212485060095787, 0.5364335179328918, 0.5937089920043945, 637 0.991003155708313, 0.3630942404270172, 0.9289674162864685, 638 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 639 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 640 ], 641 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float32'} 642 }, 643 'conv2dFilter': { 644 'data': [ 645 0.14543837308883667, 0.6952692270278931, 0.3072136342525482, 646 0.9671129584312439, 0.5070913434028625, 0.43241235613822937, 647 0.10836050659418106, 0.08139707148075104, 0.9849002361297607, 648 0.3202308118343353, 0.5303338766098022, 0.4281076192855835 649 ], 650 'descriptor': {shape: [1, 2, 2, 3], dataType: 'float32'}, 651 'constant': true 652 } 653 }, 654 'operators': [{ 655 'name': 'conv2d', 656 'arguments': [ 657 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 658 {'options': {'filterLayout': 'ihwo'}} 659 ], 660 'outputs': 'conv2dOutput' 661 }], 662 'expectedOutputs': { 663 'conv2dOutput': { 664 'data': [ 665 0.8845428228378296, 0.7413608431816101, 0.2897796928882599, 666 0.4053896367549896, 0.9626783132553101, 0.9108520746231079, 667 0.4832426905632019, 0.4878997206687927, 0.8020333051681519, 668 0.6277193427085876, 0.4483422338962555, 0.8711439371109009, 669 0.6932874917984009, 1.0369365215301514, 0.8282973766326904, 670 0.35335418581962585, 1.1787647008895874, 0.8123774528503418, 671 0.816078782081604, 0.6780439019203186, 0.9170808792114258, 672 1.082636833190918, 1.2353861331939697, 0.9810346961021423 673 ], 674 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} 675 } 676 } 677 } 678 }, 679 { 680 'name': 681 'conv2d float32 4D input and filter tensors options.inputLayout=\'nhwc\' and options.filterLayout=\'oihw\'', 682 'graph': { 683 'inputs': { 684 'conv2dInput': { 685 'data': [ 686 0.7529087066650391, 0.7520291805267334, 0.5949527621269226, 687 0.2163185328245163, 0.07589349150657654, 0.151067852973938, 688 0.1212485060095787, 0.5364335179328918, 0.5937089920043945, 689 0.991003155708313, 0.3630942404270172, 0.9289674162864685, 690 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 691 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 692 ], 693 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'} 694 }, 695 'conv2dFilter': { 696 'data': [ 697 0.14543837308883667, 0.9671129584312439, 0.10836050659418106, 698 0.3202308118343353, 0.6952692270278931, 0.5070913434028625, 699 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 700 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 701 ], 702 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float32'}, 703 'constant': true 704 } 705 }, 706 'operators': [{ 707 'name': 'conv2d', 708 'arguments': [ 709 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 710 {'options': {'inputLayout': 'nhwc', 'filterLayout': 'oihw'}} 711 ], 712 'outputs': 'conv2dOutput' 713 }], 714 'expectedOutputs': { 715 'conv2dOutput': { 716 'data': [ 717 0.8845428228378296, 0.9626783132553101, 0.8020333051681519, 718 0.7413608431816101, 0.9108520746231079, 0.6277193427085876, 719 0.2897796928882599, 0.4832426905632019, 0.4483422338962555, 720 0.4053896367549896, 0.4878997206687927, 0.8711439371109009, 721 0.6932874917984009, 1.1787647008895874, 0.9170808792114258, 722 1.0369365215301514, 0.8123774528503418, 1.082636833190918, 723 0.8282973766326904, 0.816078782081604, 1.2353861331939697, 724 0.35335418581962585, 0.6780439019203186, 0.9810346961021423 725 ], 726 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} 727 } 728 } 729 } 730 }, 731 { 732 'name': 733 'conv2d float32 4D input and filter tensors options.inputLayout=\'nhwc\' and options.filterLayout=\'hwio\'', 734 'graph': { 735 'inputs': { 736 'conv2dInput': { 737 'data': [ 738 0.7529087066650391, 0.7520291805267334, 0.5949527621269226, 739 0.2163185328245163, 0.07589349150657654, 0.151067852973938, 740 0.1212485060095787, 0.5364335179328918, 0.5937089920043945, 741 0.991003155708313, 0.3630942404270172, 0.9289674162864685, 742 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 743 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 744 ], 745 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'} 746 }, 747 'conv2dFilter': { 748 'data': [ 749 0.14543837308883667, 0.6952692270278931, 0.3072136342525482, 750 0.9671129584312439, 0.5070913434028625, 0.43241235613822937, 751 0.10836050659418106, 0.08139707148075104, 0.9849002361297607, 752 0.3202308118343353, 0.5303338766098022, 0.4281076192855835 753 ], 754 'descriptor': {shape: [2, 2, 1, 3], dataType: 'float32'}, 755 'constant': true 756 } 757 }, 758 'operators': [{ 759 'name': 'conv2d', 760 'arguments': [ 761 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 762 {'options': {'inputLayout': 'nhwc', 'filterLayout': 'hwio'}} 763 ], 764 'outputs': 'conv2dOutput' 765 }], 766 'expectedOutputs': { 767 'conv2dOutput': { 768 'data': [ 769 0.8845428228378296, 0.9626783132553101, 0.8020333051681519, 770 0.7413608431816101, 0.9108520746231079, 0.6277193427085876, 771 0.2897796928882599, 0.4832426905632019, 0.4483422338962555, 772 0.4053896367549896, 0.4878997206687927, 0.8711439371109009, 773 0.6932874917984009, 1.1787647008895874, 0.9170808792114258, 774 1.0369365215301514, 0.8123774528503418, 1.082636833190918, 775 0.8282973766326904, 0.816078782081604, 1.2353861331939697, 776 0.35335418581962585, 0.6780439019203186, 0.9810346961021423 777 ], 778 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} 779 } 780 } 781 } 782 }, 783 { 784 'name': 785 'conv2d float32 4D input and filter tensors options.inputLayout=\'nhwc\' and options.filterLayout=\'ohwi\'', 786 'graph': { 787 'inputs': { 788 'conv2dInput': { 789 'data': [ 790 0.7529087066650391, 0.7520291805267334, 0.5949527621269226, 791 0.2163185328245163, 0.07589349150657654, 0.151067852973938, 792 0.1212485060095787, 0.5364335179328918, 0.5937089920043945, 793 0.991003155708313, 0.3630942404270172, 0.9289674162864685, 794 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 795 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 796 ], 797 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'} 798 }, 799 'conv2dFilter': { 800 'data': [ 801 0.14543837308883667, 0.9671129584312439, 0.10836050659418106, 802 0.3202308118343353, 0.6952692270278931, 0.5070913434028625, 803 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 804 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 805 ], 806 'descriptor': {shape: [3, 2, 2, 1], dataType: 'float32'}, 807 'constant': true 808 } 809 }, 810 'operators': [{ 811 'name': 'conv2d', 812 'arguments': [ 813 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 814 {'options': {'inputLayout': 'nhwc', 'filterLayout': 'ohwi'}} 815 ], 816 'outputs': 'conv2dOutput' 817 }], 818 'expectedOutputs': { 819 'conv2dOutput': { 820 'data': [ 821 0.8845428228378296, 0.9626783132553101, 0.8020333051681519, 822 0.7413608431816101, 0.9108520746231079, 0.6277193427085876, 823 0.2897796928882599, 0.4832426905632019, 0.4483422338962555, 824 0.4053896367549896, 0.4878997206687927, 0.8711439371109009, 825 0.6932874917984009, 1.1787647008895874, 0.9170808792114258, 826 1.0369365215301514, 0.8123774528503418, 1.082636833190918, 827 0.8282973766326904, 0.816078782081604, 1.2353861331939697, 828 0.35335418581962585, 0.6780439019203186, 0.9810346961021423 829 ], 830 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} 831 } 832 } 833 } 834 }, 835 { 836 'name': 837 'conv2d float32 4D input and filter tensors options.inputLayout=\'nhwc\' and options.filterLayout=\'ihwo\'', 838 'graph': { 839 'inputs': { 840 'conv2dInput': { 841 'data': [ 842 0.7529087066650391, 0.7520291805267334, 0.5949527621269226, 843 0.2163185328245163, 0.07589349150657654, 0.151067852973938, 844 0.1212485060095787, 0.5364335179328918, 0.5937089920043945, 845 0.991003155708313, 0.3630942404270172, 0.9289674162864685, 846 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 847 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 848 ], 849 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'} 850 }, 851 'conv2dFilter': { 852 'data': [ 853 0.14543837308883667, 0.6952692270278931, 0.3072136342525482, 854 0.9671129584312439, 0.5070913434028625, 0.43241235613822937, 855 0.10836050659418106, 0.08139707148075104, 0.9849002361297607, 856 0.3202308118343353, 0.5303338766098022, 0.4281076192855835 857 ], 858 'descriptor': {shape: [1, 2, 2, 3], dataType: 'float32'}, 859 'constant': true 860 } 861 }, 862 'operators': [{ 863 'name': 'conv2d', 864 'arguments': [ 865 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 866 {'options': {'inputLayout': 'nhwc', 'filterLayout': 'ihwo'}} 867 ], 868 'outputs': 'conv2dOutput' 869 }], 870 'expectedOutputs': { 871 'conv2dOutput': { 872 'data': [ 873 0.8845428228378296, 0.9626783132553101, 0.8020333051681519, 874 0.7413608431816101, 0.9108520746231079, 0.6277193427085876, 875 0.2897796928882599, 0.4832426905632019, 0.4483422338962555, 876 0.4053896367549896, 0.4878997206687927, 0.8711439371109009, 877 0.6932874917984009, 1.1787647008895874, 0.9170808792114258, 878 1.0369365215301514, 0.8123774528503418, 1.082636833190918, 879 0.8282973766326904, 0.816078782081604, 1.2353861331939697, 880 0.35335418581962585, 0.6780439019203186, 0.9810346961021423 881 ], 882 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} 883 } 884 } 885 } 886 }, 887 { 888 'name': 'conv2d float32 4D input and filter tensors 1D options.bias', 889 'graph': { 890 'inputs': { 891 'conv2dInput': { 892 'data': [ 893 0.7529087066650391, 0.7520291805267334, 0.5949527621269226, 894 0.2163185328245163, 0.07589349150657654, 0.151067852973938, 895 0.1212485060095787, 0.5364335179328918, 0.5937089920043945, 896 0.991003155708313, 0.3630942404270172, 0.9289674162864685, 897 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 898 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 899 ], 900 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float32'} 901 }, 902 'conv2dFilter': { 903 'data': [ 904 0.14543837308883667, 0.9671129584312439, 0.10836050659418106, 905 0.3202308118343353, 0.6952692270278931, 0.5070913434028625, 906 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 907 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 908 ], 909 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float32'}, 910 'constant': true 911 }, 912 'conv2dBias': { 913 'data': [0.8135762214660645, 0.8394582867622375, 0.49444812536239624], 914 'descriptor': {shape: [3], dataType: 'float32'}, 915 'constant': true 916 } 917 }, 918 'operators': [{ 919 'name': 'conv2d', 920 'arguments': [ 921 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 922 {'options': {'bias': 'conv2dBias'}} 923 ], 924 'outputs': 'conv2dOutput' 925 }], 926 'expectedOutputs': { 927 'conv2dOutput': { 928 'data': [ 929 1.698119044303894, 1.5549371242523193, 1.103355884552002, 930 1.2189658880233765, 1.8021366596221924, 1.7503103017807007, 931 1.3227009773254395, 1.3273580074310303, 1.2964813709259033, 932 1.1221674680709839, 0.9427903890609741, 1.365592122077942, 933 1.5068637132644653, 1.8505127429962158, 1.6418735980987549, 934 1.1669304370880127, 2.0182230472564697, 1.6518357992172241, 935 1.6555371284484863, 1.5175021886825562, 1.4115289449691772, 936 1.577085018157959, 1.7298341989517212, 1.4754828214645386 937 ], 938 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} 939 } 940 } 941 } 942 }, 943 { 944 'name': 'conv2d float32 4D input and filter tensors all options', 945 'graph': { 946 'inputs': { 947 'conv2dInput': { 948 'data': [ 949 0.09971386939287186, 0.5374298095703125, 0.30570074915885925, 950 0.7222362160682678, 0.5066556334495544, 0.3238430619239807, 951 0.8721967935562134, 0.20989856123924255, 0.5052645802497864, 952 0.026870572939515114, 0.5497115850448608, 0.06430311501026154, 953 0.1560668647289276, 0.11970008909702301, 0.036145713180303574, 954 0.41425615549087524, 0.2417246550321579, 0.6771785020828247, 955 0.2087000161409378, 0.10979551076889038, 0.745035707950592, 956 0.7443592548370361, 0.7873413562774658, 0.5887080430984497, 957 0.11018028855323792, 0.9045036435127258, 0.11725221574306488, 958 0.8508669137954712, 0.4244919717311859, 0.02537914551794529, 959 0.747390866279602, 0.4645859897136688, 0.030408121645450592, 960 0.4244018793106079, 0.3847547769546509, 0.7581132650375366, 961 0.9901952147483826, 0.03716852888464928, 0.014496322721242905, 962 0.8263142108917236, 0.21072064340114594, 0.6569713950157166, 963 0.25842806696891785, 0.4802338480949402, 0.9704219102859497, 964 0.2968284785747528, 0.7524365782737732, 0.029636209830641747, 965 0.09028015285730362, 0.77818763256073 966 ], 967 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 968 }, 969 'conv2dFilter': { 970 'data': [ 971 0.6385681629180908, 0.07764163613319397, 0.1291629821062088, 972 0.45633891224861145, 0.40438535809516907, 0.5943626761436462, 973 0.14241264760494232, 0.9036700129508972 974 ], 975 'descriptor': {shape: [2, 2, 1, 2], dataType: 'float32'}, 976 'constant': true 977 }, 978 'conv2dBias': { 979 'data': [0.542375385761261, 0.8406118750572205], 980 'descriptor': {shape: [2], dataType: 'float32'}, 981 'constant': true 982 } 983 }, 984 'operators': [{ 985 'name': 'conv2d', 986 'arguments': [ 987 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, { 988 'options': { 989 'padding': [1, 0, 0, 1], 990 'strides': [1, 1], 991 'dilations': [1, 1], 992 'groups': 2, 993 'inputLayout': 'nchw', 994 'filterLayout': 'hwio', 995 'bias': 'conv2dBias' 996 } 997 } 998 ], 999 'outputs': 'conv2dOutput' 1000 }], 1001 'expectedOutputs': { 1002 'conv2dOutput': { 1003 'data': [ 1004 0.6592350006103516, 0.8032397627830505, 0.7688518762588501, 1005 0.9065912961959839, 0.7472594976425171, 0.9306347966194153, 1006 1.3076419830322266, 0.987708330154419, 1.277161955833435, 1007 0.8767756223678589, 1.0932797193527222, 1.1746727228164673, 1008 0.8218293786048889, 0.9220445156097412, 0.5741508603096008, 1009 1.103653073310852, 0.7977840900421143, 0.9610581398010254, 1010 0.7235122323036194, 0.6098566055297852, 1.2454158067703247, 1011 1.1973347663879395, 1.4039851427078247, 0.9435820579528809, 1012 0.6570426225662231, 1.4841723442077637, 1.6792051792144775, 1013 1.729936122894287, 1.115848422050476, 0.8556963205337524, 1014 1.828399419784546, 1.5416107177734375, 1.5019794702529907, 1015 1.4850915670394897, 1.0712661743164062, 2.4560532569885254, 1016 1.5126826763153076, 1.0718353986740112, 1.8044731616973877, 1017 1.3616151809692383, 2.07026743888855, 1.5584666728973389, 1018 1.4376858472824097, 2.3811910152435303, 1.4815508127212524, 1019 2.0131523609161377, 1.4835525751113892, 1.1790242195129395, 1020 2.0776233673095703, 1.378482699394226 1021 ], 1022 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 1023 } 1024 } 1025 } 1026 }, 1027 { 1028 'name': 1029 'conv2d float32 4D input and filter tensors, both negative input tensor and options.bias', 1030 'graph': { 1031 'inputs': { 1032 'conv2dInput': { 1033 'data': [ 1034 -0.8073334693908691, -0.8839999437332153, -0.7700487375259399, 1035 -0.5646049380302429, -0.39717939496040344, -0.10841356962919235, 1036 -0.5519214868545532, -0.3954172134399414, -0.057589758187532425, 1037 -0.5144240856170654, -0.21321901679039001, -0.950609028339386, 1038 -0.8043696880340576, -0.8646378517150879, -0.9607220888137817, 1039 -0.3264438509941101, -0.06884296983480453, -0.3203399181365967, 1040 -0.2692728042602539, -0.3430887758731842, -0.8989502191543579, 1041 -0.9038569331169128, -0.6369403004646301, -0.20070797204971313, 1042 -0.7870702147483826, -0.3467883765697479, -0.060042694211006165, 1043 -0.14985208213329315, -0.6482332348823547, -0.8934088349342346, 1044 -0.8149284720420837, -0.6423668265342712, -0.032736241817474365, 1045 -0.6608918905258179, -0.5843491554260254, -0.09921254217624664, 1046 -0.16602523624897003, -0.9508541822433472, -0.3051462769508362, 1047 -0.6210587024688721, -0.5400903820991516, -0.42009180784225464, 1048 -0.18824540078639984, -0.3588937520980835, -0.7114293575286865, 1049 -0.3751019835472107, -0.7108227610588074, -0.36050301790237427, 1050 -0.5468712449073792, -0.032261595129966736 1051 ], 1052 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 1053 }, 1054 'conv2dFilter': { 1055 'data': [ 1056 0.6385681629180908, 0.07764163613319397, 0.1291629821062088, 1057 0.45633891224861145, 0.40438535809516907, 0.5943626761436462, 1058 0.14241264760494232, 0.9036700129508972 1059 ], 1060 'descriptor': {shape: [2, 2, 1, 2], dataType: 'float32'}, 1061 'constant': true 1062 }, 1063 'conv2dBias': { 1064 'data': [-0.37496936321258545, -0.4363507032394409], 1065 'descriptor': {shape: [2], dataType: 'float32'}, 1066 'constant': true 1067 } 1068 }, 1069 'operators': [{ 1070 'name': 'conv2d', 1071 'arguments': [ 1072 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, { 1073 'options': { 1074 'padding': [1, 0, 0, 1], 1075 'groups': 2, 1076 'filterLayout': 'hwio', 1077 'bias': 'conv2dBias' 1078 } 1079 } 1080 ], 1081 'outputs': 'conv2dOutput' 1082 }], 1083 'expectedOutputs': { 1084 'conv2dOutput': { 1085 'data': [ 1086 -0.8273359537124634, -0.8421106934547424, -0.7667726874351501, 1087 -0.6598507165908813, -0.5355829000473022, -1.1271283626556396, 1088 -1.3184267282485962, -1.1077264547348022, -0.8833579421043396, 1089 -0.8366210460662842, -0.7370880246162415, -1.2774468660354614, 1090 -1.0833193063735962, -0.9646547436714172, -1.091966152191162, 1091 -0.7757209539413452, -1.1593523025512695, -1.1681820154190063, 1092 -1.2089394330978394, -1.127195954322815, -1.0845609903335571, 1093 -0.9165211915969849, -0.9004610180854797, -0.78448486328125, 1094 -0.9123346209526062, -0.6967275738716125, -0.6074546575546265, 1095 -1.1112061738967896, -1.6289831399917603, -0.9673595428466797, 1096 -1.5555264949798584, -0.9207774996757507, -1.3604848384857178, 1097 -1.8152461051940918, -0.8530317544937134, -1.0017603635787964, 1098 -1.4591015577316284, -1.5813868045806885, -1.4969244003295898, 1099 -0.8508546352386475, -1.2204514741897583, -1.3029515743255615, 1100 -1.0856342315673828, -1.5996664762496948, -0.9074177742004395, 1101 -1.5352842807769775, -1.303133249282837, -1.3232042789459229, 1102 -1.1430623531341553, -0.5107623338699341 1103 ], 1104 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} 1105 } 1106 } 1107 } 1108 }, 1109 1110 // float16 tests 1111 { 1112 'name': 1113 'conv2d float16 4D both input and filter non-constant tensors default options', 1114 'graph': { 1115 'inputs': { 1116 'conv2dInput': { 1117 'data': [ 1118 0.6123046875, 0.8857421875, 0.13671875, 1119 0.564453125, 0.896484375, 0.367919921875, 1120 0.68115234375, 0.047943115234375, 0.33349609375, 1121 0.1988525390625, 0.41162109375, 0.079345703125, 1122 0.42724609375, 0.53564453125, 0.59130859375, 1123 0.2841796875, 0.414794921875, 0.0269012451171875, 1124 0.362060546875, 0.99462890625, 0.07183837890625, 1125 0.1220703125, 0.84228515625, 0.453857421875, 1126 0.21533203125 1127 ], 1128 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float16'} 1129 }, 1130 'conv2dFilter': { 1131 'data': [ 1132 0.38037109375, 0.52783203125, 0.219482421875, 0.366943359375, 1133 0.33984375, 0.419921875, 0.380615234375, 0.1944580078125, 1134 0.56884765625 1135 ], 1136 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float16'} 1137 } 1138 }, 1139 'operators': [{ 1140 'name': 'conv2d', 1141 'arguments': [{'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}], 1142 'outputs': 'conv2dOutput' 1143 }], 1144 'expectedOutputs': { 1145 'conv2dOutput': { 1146 'data': [ 1147 1.5322265625, 1.357421875, 1.3642578125, 1.0712890625, 1.1259765625, 1148 1.4716796875, 1.0791015625, 1.1552734375, 1.6572265625 1149 ], 1150 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float16'} 1151 } 1152 } 1153 } 1154 }, 1155 { 1156 'name': 1157 'conv2d float16 4D both input and filter constant tensors default options', 1158 'graph': { 1159 'inputs': { 1160 'conv2dInput': { 1161 'data': [ 1162 0.6123046875, 0.8857421875, 0.13671875, 1163 0.564453125, 0.896484375, 0.367919921875, 1164 0.68115234375, 0.047943115234375, 0.33349609375, 1165 0.1988525390625, 0.41162109375, 0.079345703125, 1166 0.42724609375, 0.53564453125, 0.59130859375, 1167 0.2841796875, 0.414794921875, 0.0269012451171875, 1168 0.362060546875, 0.99462890625, 0.07183837890625, 1169 0.1220703125, 0.84228515625, 0.453857421875, 1170 0.21533203125 1171 ], 1172 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float16'}, 1173 'constant': true 1174 }, 1175 'conv2dFilter': { 1176 'data': [ 1177 0.38037109375, 0.52783203125, 0.219482421875, 0.366943359375, 1178 0.33984375, 0.419921875, 0.380615234375, 0.1944580078125, 1179 0.56884765625 1180 ], 1181 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float16'}, 1182 'constant': true 1183 } 1184 }, 1185 'operators': [{ 1186 'name': 'conv2d', 1187 'arguments': [{'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}], 1188 'outputs': 'conv2dOutput' 1189 }], 1190 'expectedOutputs': { 1191 'conv2dOutput': { 1192 'data': [ 1193 1.5322265625, 1.357421875, 1.3642578125, 1.0712890625, 1.1259765625, 1194 1.4716796875, 1.0791015625, 1.1552734375, 1.6572265625 1195 ], 1196 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float16'} 1197 } 1198 } 1199 } 1200 }, 1201 { 1202 'name': 'conv2d float16 4D input and filter tensors default options', 1203 'graph': { 1204 'inputs': { 1205 'conv2dInput': { 1206 'data': [ 1207 0.6123046875, 0.8857421875, 0.13671875, 1208 0.564453125, 0.896484375, 0.367919921875, 1209 0.68115234375, 0.047943115234375, 0.33349609375, 1210 0.1988525390625, 0.41162109375, 0.079345703125, 1211 0.42724609375, 0.53564453125, 0.59130859375, 1212 0.2841796875, 0.414794921875, 0.0269012451171875, 1213 0.362060546875, 0.99462890625, 0.07183837890625, 1214 0.1220703125, 0.84228515625, 0.453857421875, 1215 0.21533203125 1216 ], 1217 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float16'} 1218 }, 1219 'conv2dFilter': { 1220 'data': [ 1221 0.38037109375, 0.52783203125, 0.219482421875, 0.366943359375, 1222 0.33984375, 0.419921875, 0.380615234375, 0.1944580078125, 1223 0.56884765625 1224 ], 1225 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float16'}, 1226 'constant': true 1227 } 1228 }, 1229 'operators': [{ 1230 'name': 'conv2d', 1231 'arguments': [{'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}], 1232 'outputs': 'conv2dOutput' 1233 }], 1234 'expectedOutputs': { 1235 'conv2dOutput': { 1236 'data': [ 1237 1.5322265625, 1.357421875, 1.3642578125, 1.0712890625, 1.1259765625, 1238 1.4716796875, 1.0791015625, 1.1552734375, 1.6572265625 1239 ], 1240 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float16'} 1241 } 1242 } 1243 } 1244 }, 1245 { 1246 'name': 'conv2d float16 4D input and filter tensors options.padding', 1247 'graph': { 1248 'inputs': { 1249 'conv2dInput': { 1250 'data': [ 1251 0.6123046875, 0.8857421875, 0.13671875, 1252 0.564453125, 0.896484375, 0.367919921875, 1253 0.68115234375, 0.047943115234375, 0.33349609375, 1254 0.1988525390625, 0.41162109375, 0.079345703125, 1255 0.42724609375, 0.53564453125, 0.59130859375, 1256 0.2841796875, 0.414794921875, 0.0269012451171875, 1257 0.362060546875, 0.99462890625, 0.07183837890625, 1258 0.1220703125, 0.84228515625, 0.453857421875, 1259 0.21533203125 1260 ], 1261 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float16'} 1262 }, 1263 'conv2dFilter': { 1264 'data': [ 1265 0.38037109375, 0.52783203125, 0.219482421875, 0.366943359375, 1266 0.33984375, 0.419921875, 0.380615234375, 0.1944580078125, 1267 0.56884765625 1268 ], 1269 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float16'}, 1270 'constant': true 1271 } 1272 }, 1273 'operators': [{ 1274 'name': 'conv2d', 1275 'arguments': [ 1276 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1277 {'options': {'padding': [1, 1, 1, 1]}} 1278 ], 1279 'outputs': 'conv2dOutput' 1280 }], 1281 'expectedOutputs': { 1282 'conv2dOutput': { 1283 'data': [ 1284 1.0390625, 0.8828125, 1.06640625, 0.814453125, 1285 0.67724609375, 1.0537109375, 1.5322265625, 1.357421875, 1286 1.3642578125, 1.1962890625, 0.80810546875, 1.0712890625, 1287 1.1259765625, 1.4716796875, 0.96044921875, 0.5888671875, 1288 1.0791015625, 1.1552734375, 1.6572265625, 1.201171875, 1289 0.316650390625, 0.75439453125, 0.77294921875, 0.97314453125, 1290 0.90234375 1291 ], 1292 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float16'} 1293 } 1294 } 1295 } 1296 }, 1297 { 1298 'name': 'conv2d float16 4D input and filter tensors options.strides', 1299 'graph': { 1300 'inputs': { 1301 'conv2dInput': { 1302 'data': [ 1303 0.6123046875, 0.8857421875, 0.13671875, 1304 0.564453125, 0.896484375, 0.367919921875, 1305 0.68115234375, 0.047943115234375, 0.33349609375, 1306 0.1988525390625, 0.41162109375, 0.079345703125, 1307 0.42724609375, 0.53564453125, 0.59130859375, 1308 0.2841796875, 0.414794921875, 0.0269012451171875, 1309 0.362060546875, 0.99462890625, 0.07183837890625, 1310 0.1220703125, 0.84228515625, 0.453857421875, 1311 0.21533203125 1312 ], 1313 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float16'} 1314 }, 1315 'conv2dFilter': { 1316 'data': [ 1317 0.38037109375, 0.52783203125, 0.219482421875, 0.366943359375, 1318 0.33984375, 0.419921875, 0.380615234375, 0.1944580078125, 1319 0.56884765625 1320 ], 1321 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float16'}, 1322 'constant': true 1323 } 1324 }, 1325 'operators': [{ 1326 'name': 'conv2d', 1327 'arguments': [ 1328 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1329 {'options': {'strides': [2, 2]}} 1330 ], 1331 'outputs': 'conv2dOutput' 1332 }], 1333 'expectedOutputs': { 1334 'conv2dOutput': { 1335 'data': [1.5322265625, 1.3642578125, 1.0791015625, 1.6572265625], 1336 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float16'} 1337 } 1338 } 1339 } 1340 }, 1341 { 1342 'name': 'conv2d float16 4D input and filter tensors options.dilations', 1343 'graph': { 1344 'inputs': { 1345 'conv2dInput': { 1346 'data': [ 1347 0.6123046875, 0.8857421875, 0.13671875, 1348 0.564453125, 0.896484375, 0.367919921875, 1349 0.68115234375, 0.047943115234375, 0.33349609375, 1350 0.1988525390625, 0.41162109375, 0.079345703125, 1351 0.42724609375, 0.53564453125, 0.59130859375, 1352 0.2841796875, 0.414794921875, 0.0269012451171875, 1353 0.362060546875, 0.99462890625, 0.07183837890625, 1354 0.1220703125, 0.84228515625, 0.453857421875, 1355 0.21533203125 1356 ], 1357 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float16'} 1358 }, 1359 'conv2dFilter': { 1360 'data': [ 1361 0.38037109375, 0.52783203125, 0.219482421875, 0.366943359375, 1362 0.33984375, 0.419921875, 0.380615234375, 0.1944580078125, 1363 0.56884765625 1364 ], 1365 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float16'}, 1366 'constant': true 1367 } 1368 }, 1369 'operators': [{ 1370 'name': 'conv2d', 1371 'arguments': [ 1372 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1373 {'options': {'dilations': [2, 2]}} 1374 ], 1375 'outputs': 'conv2dOutput' 1376 }], 1377 'expectedOutputs': { 1378 'conv2dOutput': { 1379 'data': [1.3603515625], 1380 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float16'} 1381 } 1382 } 1383 } 1384 }, 1385 { 1386 'name': 1387 'depthwise conv2d float16 4D input and filter tensors options.groups= input_channels', 1388 'graph': { 1389 'inputs': { 1390 'conv2dInput': { 1391 'data': [ 1392 0.8447265625, 0.943359375, 0.65576171875, 0.6982421875, 1393 0.99951171875, 0.2366943359375, 0.367431640625, 0.261962890625, 1394 0.62548828125, 0.84033203125, 0.37841796875, 0.454345703125, 1395 0.253173828125, 0.578125, 0.54150390625, 0.37841796875 1396 ], 1397 'descriptor': {shape: [1, 4, 2, 2], dataType: 'float16'} 1398 }, 1399 'conv2dFilter': { 1400 'data': [ 1401 0.272216796875, 0.28125, 0.8544921875, 0.1796875, 0.7763671875, 1402 0.51416015625, 0.63720703125, 0.1280517578125, 0.83740234375, 1403 0.57275390625, 0.09857177734375, 0.5927734375, 0.58984375, 1404 0.96923828125, 0.2318115234375, 0.1480712890625 1405 ], 1406 'descriptor': {shape: [4, 1, 2, 2], dataType: 'float16'}, 1407 'constant': true 1408 } 1409 }, 1410 'operators': [{ 1411 'name': 'conv2d', 1412 'arguments': [ 1413 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1414 {'options': {'groups': 4}} 1415 ], 1416 'outputs': 'conv2dOutput' 1417 }], 1418 'expectedOutputs': { 1419 'conv2dOutput': { 1420 'data': [1.1806640625, 1.1650390625, 1.3115234375, 0.89111328125], 1421 'descriptor': {shape: [1, 4, 1, 1], dataType: 'float16'} 1422 } 1423 } 1424 } 1425 }, 1426 { 1427 'name': 1428 'conv2d float16 4D input and filter tensors options.inputLayout=\'nchw\'', 1429 'graph': { 1430 'inputs': { 1431 'conv2dInput': { 1432 'data': [ 1433 0.7529296875, 0.751953125, 0.5947265625, 0.21630859375, 1434 0.07586669921875, 0.151123046875, 0.12127685546875, 0.53662109375, 1435 0.59375, 0.9912109375, 0.363037109375, 0.92919921875, 1436 0.227294921875, 0.54150390625, 0.08447265625, 0.6767578125, 1437 0.619140625, 0.392822265625 1438 ], 1439 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float16'} 1440 }, 1441 'conv2dFilter': { 1442 'data': [ 1443 0.1453857421875, 0.96728515625, 0.10833740234375, 0.3203125, 1444 0.6953125, 0.50732421875, 0.0814208984375, 0.5302734375, 1445 0.30712890625, 0.432373046875, 0.98486328125, 0.42822265625 1446 ], 1447 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float16'}, 1448 'constant': true 1449 } 1450 }, 1451 'operators': [{ 1452 'name': 'conv2d', 1453 'arguments': [ 1454 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1455 {'options': {'inputLayout': 'nchw'}} 1456 ], 1457 'outputs': 'conv2dOutput' 1458 }], 1459 'expectedOutputs': { 1460 'conv2dOutput': { 1461 'data': [ 1462 0.884765625, 0.7412109375, 0.289794921875, 0.405517578125, 1463 0.962890625, 0.91064453125, 0.4833984375, 0.488037109375, 1464 0.8017578125, 0.62744140625, 0.448486328125, 0.87158203125, 1465 0.693359375, 1.037109375, 0.82861328125, 0.353271484375, 1466 1.1787109375, 0.8125, 0.81640625, 0.67822265625, 1467 0.9169921875, 1.0830078125, 1.2353515625, 0.98095703125 1468 ], 1469 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'} 1470 } 1471 } 1472 } 1473 }, 1474 { 1475 'name': 1476 'conv2d float16 4D input and filter tensors options.inputLayout=\'nhwc\'', 1477 'graph': { 1478 'inputs': { 1479 'conv2dInput': { 1480 'data': [ 1481 0.7529296875, 0.751953125, 0.5947265625, 0.21630859375, 1482 0.07586669921875, 0.151123046875, 0.12127685546875, 0.53662109375, 1483 0.59375, 0.9912109375, 0.363037109375, 0.92919921875, 1484 0.227294921875, 0.54150390625, 0.08447265625, 0.6767578125, 1485 0.619140625, 0.392822265625 1486 ], 1487 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float16'} 1488 }, 1489 'conv2dFilter': { 1490 'data': [ 1491 0.1453857421875, 0.96728515625, 0.10833740234375, 0.3203125, 1492 0.6953125, 0.50732421875, 0.0814208984375, 0.5302734375, 1493 0.30712890625, 0.432373046875, 0.98486328125, 0.42822265625 1494 ], 1495 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float16'}, 1496 'constant': true 1497 } 1498 }, 1499 'operators': [{ 1500 'name': 'conv2d', 1501 'arguments': [ 1502 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1503 {'options': {'inputLayout': 'nhwc'}} 1504 ], 1505 'outputs': 'conv2dOutput' 1506 }], 1507 'expectedOutputs': { 1508 'conv2dOutput': { 1509 'data': [ 1510 0.884765625, 0.962890625, 0.8017578125, 0.7412109375, 1511 0.91064453125, 0.62744140625, 0.289794921875, 0.4833984375, 1512 0.448486328125, 0.405517578125, 0.488037109375, 0.87158203125, 1513 0.693359375, 1.1787109375, 0.9169921875, 1.037109375, 1514 0.8125, 1.0830078125, 0.82861328125, 0.81640625, 1515 1.2353515625, 0.353271484375, 0.67822265625, 0.98095703125 1516 ], 1517 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} 1518 } 1519 } 1520 } 1521 }, 1522 { 1523 'name': 1524 'conv2d float16 4D input and filter tensors options.filterLayout=\'oihw\'', 1525 'graph': { 1526 'inputs': { 1527 'conv2dInput': { 1528 'data': [ 1529 0.7529296875, 0.751953125, 0.5947265625, 0.21630859375, 1530 0.07586669921875, 0.151123046875, 0.12127685546875, 0.53662109375, 1531 0.59375, 0.9912109375, 0.363037109375, 0.92919921875, 1532 0.227294921875, 0.54150390625, 0.08447265625, 0.6767578125, 1533 0.619140625, 0.392822265625 1534 ], 1535 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float16'} 1536 }, 1537 'conv2dFilter': { 1538 'data': [ 1539 0.1453857421875, 0.96728515625, 0.10833740234375, 0.3203125, 1540 0.6953125, 0.50732421875, 0.0814208984375, 0.5302734375, 1541 0.30712890625, 0.432373046875, 0.98486328125, 0.42822265625 1542 ], 1543 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float16'}, 1544 'constant': true 1545 } 1546 }, 1547 'operators': [{ 1548 'name': 'conv2d', 1549 'arguments': [ 1550 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1551 {'options': {'filterLayout': 'oihw'}} 1552 ], 1553 'outputs': 'conv2dOutput' 1554 }], 1555 'expectedOutputs': { 1556 'conv2dOutput': { 1557 'data': [ 1558 0.884765625, 0.7412109375, 0.289794921875, 0.405517578125, 1559 0.962890625, 0.91064453125, 0.4833984375, 0.488037109375, 1560 0.8017578125, 0.62744140625, 0.448486328125, 0.87158203125, 1561 0.693359375, 1.037109375, 0.82861328125, 0.353271484375, 1562 1.1787109375, 0.8125, 0.81640625, 0.67822265625, 1563 0.9169921875, 1.0830078125, 1.2353515625, 0.98095703125 1564 ], 1565 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'} 1566 } 1567 } 1568 } 1569 }, 1570 { 1571 'name': 1572 'conv2d float16 4D input and filter tensors options.filterLayout=\'hwio\'', 1573 'graph': { 1574 'inputs': { 1575 'conv2dInput': { 1576 'data': [ 1577 0.7529296875, 0.751953125, 0.5947265625, 0.21630859375, 1578 0.07586669921875, 0.151123046875, 0.12127685546875, 0.53662109375, 1579 0.59375, 0.9912109375, 0.363037109375, 0.92919921875, 1580 0.227294921875, 0.54150390625, 0.08447265625, 0.6767578125, 1581 0.619140625, 0.392822265625 1582 ], 1583 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float16'} 1584 }, 1585 'conv2dFilter': { 1586 'data': [ 1587 0.1453857421875, 0.6953125, 0.30712890625, 0.96728515625, 1588 0.50732421875, 0.432373046875, 0.10833740234375, 0.0814208984375, 1589 0.98486328125, 0.3203125, 0.5302734375, 0.42822265625 1590 ], 1591 'descriptor': {shape: [2, 2, 1, 3], dataType: 'float16'}, 1592 'constant': true 1593 } 1594 }, 1595 'operators': [{ 1596 'name': 'conv2d', 1597 'arguments': [ 1598 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1599 {'options': {'filterLayout': 'hwio'}} 1600 ], 1601 'outputs': 'conv2dOutput' 1602 }], 1603 'expectedOutputs': { 1604 'conv2dOutput': { 1605 'data': [ 1606 0.884765625, 0.7412109375, 0.289794921875, 0.405517578125, 1607 0.962890625, 0.91064453125, 0.4833984375, 0.488037109375, 1608 0.8017578125, 0.62744140625, 0.448486328125, 0.87158203125, 1609 0.693359375, 1.037109375, 0.82861328125, 0.353271484375, 1610 1.1787109375, 0.8125, 0.81640625, 0.67822265625, 1611 0.9169921875, 1.0830078125, 1.2353515625, 0.98095703125 1612 ], 1613 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'} 1614 } 1615 } 1616 } 1617 }, 1618 { 1619 'name': 1620 'conv2d float16 4D input and filter tensors options.filterLayout=\'ohwi\'', 1621 'graph': { 1622 'inputs': { 1623 'conv2dInput': { 1624 'data': [ 1625 0.7529296875, 0.751953125, 0.5947265625, 0.21630859375, 1626 0.07586669921875, 0.151123046875, 0.12127685546875, 0.53662109375, 1627 0.59375, 0.9912109375, 0.363037109375, 0.92919921875, 1628 0.227294921875, 0.54150390625, 0.08447265625, 0.6767578125, 1629 0.619140625, 0.392822265625 1630 ], 1631 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float16'} 1632 }, 1633 'conv2dFilter': { 1634 'data': [ 1635 0.1453857421875, 0.96728515625, 0.10833740234375, 0.3203125, 1636 0.6953125, 0.50732421875, 0.0814208984375, 0.5302734375, 1637 0.30712890625, 0.432373046875, 0.98486328125, 0.42822265625 1638 ], 1639 'descriptor': {shape: [3, 2, 2, 1], dataType: 'float16'}, 1640 'constant': true 1641 } 1642 }, 1643 'operators': [{ 1644 'name': 'conv2d', 1645 'arguments': [ 1646 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1647 {'options': {'filterLayout': 'ohwi'}} 1648 ], 1649 'outputs': 'conv2dOutput' 1650 }], 1651 'expectedOutputs': { 1652 'conv2dOutput': { 1653 'data': [ 1654 0.884765625, 0.7412109375, 0.289794921875, 0.405517578125, 1655 0.962890625, 0.91064453125, 0.4833984375, 0.488037109375, 1656 0.8017578125, 0.62744140625, 0.448486328125, 0.87158203125, 1657 0.693359375, 1.037109375, 0.82861328125, 0.353271484375, 1658 1.1787109375, 0.8125, 0.81640625, 0.67822265625, 1659 0.9169921875, 1.0830078125, 1.2353515625, 0.98095703125 1660 ], 1661 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'} 1662 } 1663 } 1664 } 1665 }, 1666 { 1667 'name': 1668 'conv2d float16 4D input and filter tensors options.filterLayout=\'ihwo\'', 1669 'graph': { 1670 'inputs': { 1671 'conv2dInput': { 1672 'data': [ 1673 0.7529296875, 0.751953125, 0.5947265625, 0.21630859375, 1674 0.07586669921875, 0.151123046875, 0.12127685546875, 0.53662109375, 1675 0.59375, 0.9912109375, 0.363037109375, 0.92919921875, 1676 0.227294921875, 0.54150390625, 0.08447265625, 0.6767578125, 1677 0.619140625, 0.392822265625 1678 ], 1679 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float16'} 1680 }, 1681 'conv2dFilter': { 1682 'data': [ 1683 0.1453857421875, 0.6953125, 0.30712890625, 0.96728515625, 1684 0.50732421875, 0.432373046875, 0.10833740234375, 0.0814208984375, 1685 0.98486328125, 0.3203125, 0.5302734375, 0.42822265625 1686 ], 1687 'descriptor': {shape: [1, 2, 2, 3], dataType: 'float16'}, 1688 'constant': true 1689 } 1690 }, 1691 'operators': [{ 1692 'name': 'conv2d', 1693 'arguments': [ 1694 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1695 {'options': {'filterLayout': 'ihwo'}} 1696 ], 1697 'outputs': 'conv2dOutput' 1698 }], 1699 'expectedOutputs': { 1700 'conv2dOutput': { 1701 'data': [ 1702 0.884765625, 0.7412109375, 0.289794921875, 0.405517578125, 1703 0.962890625, 0.91064453125, 0.4833984375, 0.488037109375, 1704 0.8017578125, 0.62744140625, 0.448486328125, 0.87158203125, 1705 0.693359375, 1.037109375, 0.82861328125, 0.353271484375, 1706 1.1787109375, 0.8125, 0.81640625, 0.67822265625, 1707 0.9169921875, 1.0830078125, 1.2353515625, 0.98095703125 1708 ], 1709 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'} 1710 } 1711 } 1712 } 1713 }, 1714 { 1715 'name': 1716 'conv2d float16 4D input and filter tensors options.inputLayout=\'nhwc\' and options.filterLayout=\'oihw\'', 1717 'graph': { 1718 'inputs': { 1719 'conv2dInput': { 1720 'data': [ 1721 0.7529296875, 0.751953125, 0.5947265625, 0.21630859375, 1722 0.07586669921875, 0.151123046875, 0.12127685546875, 0.53662109375, 1723 0.59375, 0.9912109375, 0.363037109375, 0.92919921875, 1724 0.227294921875, 0.54150390625, 0.08447265625, 0.6767578125, 1725 0.619140625, 0.392822265625 1726 ], 1727 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float16'} 1728 }, 1729 'conv2dFilter': { 1730 'data': [ 1731 0.1453857421875, 0.96728515625, 0.10833740234375, 0.3203125, 1732 0.6953125, 0.50732421875, 0.0814208984375, 0.5302734375, 1733 0.30712890625, 0.432373046875, 0.98486328125, 0.42822265625 1734 ], 1735 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float16'}, 1736 'constant': true 1737 } 1738 }, 1739 'operators': [{ 1740 'name': 'conv2d', 1741 'arguments': [ 1742 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1743 {'options': {'inputLayout': 'nhwc', 'filterLayout': 'oihw'}} 1744 ], 1745 'outputs': 'conv2dOutput' 1746 }], 1747 'expectedOutputs': { 1748 'conv2dOutput': { 1749 'data': [ 1750 0.884765625, 0.962890625, 0.8017578125, 0.7412109375, 1751 0.91064453125, 0.62744140625, 0.289794921875, 0.4833984375, 1752 0.448486328125, 0.405517578125, 0.488037109375, 0.87158203125, 1753 0.693359375, 1.1787109375, 0.9169921875, 1.037109375, 1754 0.8125, 1.0830078125, 0.82861328125, 0.81640625, 1755 1.2353515625, 0.353271484375, 0.67822265625, 0.98095703125 1756 ], 1757 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} 1758 } 1759 } 1760 } 1761 }, 1762 { 1763 'name': 1764 'conv2d float16 4D input and filter tensors options.inputLayout=\'nhwc\' and options.filterLayout=\'hwio\'', 1765 'graph': { 1766 'inputs': { 1767 'conv2dInput': { 1768 'data': [ 1769 0.7529296875, 0.751953125, 0.5947265625, 0.21630859375, 1770 0.07586669921875, 0.151123046875, 0.12127685546875, 0.53662109375, 1771 0.59375, 0.9912109375, 0.363037109375, 0.92919921875, 1772 0.227294921875, 0.54150390625, 0.08447265625, 0.6767578125, 1773 0.619140625, 0.392822265625 1774 ], 1775 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float16'} 1776 }, 1777 'conv2dFilter': { 1778 'data': [ 1779 0.1453857421875, 0.6953125, 0.30712890625, 0.96728515625, 1780 0.50732421875, 0.432373046875, 0.10833740234375, 0.0814208984375, 1781 0.98486328125, 0.3203125, 0.5302734375, 0.42822265625 1782 ], 1783 'descriptor': {shape: [2, 2, 1, 3], dataType: 'float16'}, 1784 'constant': true 1785 } 1786 }, 1787 'operators': [{ 1788 'name': 'conv2d', 1789 'arguments': [ 1790 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1791 {'options': {'inputLayout': 'nhwc', 'filterLayout': 'hwio'}} 1792 ], 1793 'outputs': 'conv2dOutput' 1794 }], 1795 'expectedOutputs': { 1796 'conv2dOutput': { 1797 'data': [ 1798 0.884765625, 0.962890625, 0.8017578125, 0.7412109375, 1799 0.91064453125, 0.62744140625, 0.289794921875, 0.4833984375, 1800 0.448486328125, 0.405517578125, 0.488037109375, 0.87158203125, 1801 0.693359375, 1.1787109375, 0.9169921875, 1.037109375, 1802 0.8125, 1.0830078125, 0.82861328125, 0.81640625, 1803 1.2353515625, 0.353271484375, 0.67822265625, 0.98095703125 1804 ], 1805 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} 1806 } 1807 } 1808 } 1809 }, 1810 { 1811 'name': 1812 'conv2d float16 4D input and filter tensors options.inputLayout=\'nhwc\' and options.filterLayout=\'ohwi\'', 1813 'graph': { 1814 'inputs': { 1815 'conv2dInput': { 1816 'data': [ 1817 0.7529296875, 0.751953125, 0.5947265625, 0.21630859375, 1818 0.07586669921875, 0.151123046875, 0.12127685546875, 0.53662109375, 1819 0.59375, 0.9912109375, 0.363037109375, 0.92919921875, 1820 0.227294921875, 0.54150390625, 0.08447265625, 0.6767578125, 1821 0.619140625, 0.392822265625 1822 ], 1823 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float16'} 1824 }, 1825 'conv2dFilter': { 1826 'data': [ 1827 0.1453857421875, 0.96728515625, 0.10833740234375, 0.3203125, 1828 0.6953125, 0.50732421875, 0.0814208984375, 0.5302734375, 1829 0.30712890625, 0.432373046875, 0.98486328125, 0.42822265625 1830 ], 1831 'descriptor': {shape: [3, 2, 2, 1], dataType: 'float16'}, 1832 'constant': true 1833 } 1834 }, 1835 'operators': [{ 1836 'name': 'conv2d', 1837 'arguments': [ 1838 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1839 {'options': {'inputLayout': 'nhwc', 'filterLayout': 'ohwi'}} 1840 ], 1841 'outputs': 'conv2dOutput' 1842 }], 1843 'expectedOutputs': { 1844 'conv2dOutput': { 1845 'data': [ 1846 0.884765625, 0.962890625, 0.8017578125, 0.7412109375, 1847 0.91064453125, 0.62744140625, 0.289794921875, 0.4833984375, 1848 0.448486328125, 0.405517578125, 0.488037109375, 0.87158203125, 1849 0.693359375, 1.1787109375, 0.9169921875, 1.037109375, 1850 0.8125, 1.0830078125, 0.82861328125, 0.81640625, 1851 1.2353515625, 0.353271484375, 0.67822265625, 0.98095703125 1852 ], 1853 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} 1854 } 1855 } 1856 } 1857 }, 1858 { 1859 'name': 1860 'conv2d float16 4D input and filter tensors options.inputLayout=\'nhwc\' and options.filterLayout=\'ihwo\'', 1861 'graph': { 1862 'inputs': { 1863 'conv2dInput': { 1864 'data': [ 1865 0.7529296875, 0.751953125, 0.5947265625, 0.21630859375, 1866 0.07586669921875, 0.151123046875, 0.12127685546875, 0.53662109375, 1867 0.59375, 0.9912109375, 0.363037109375, 0.92919921875, 1868 0.227294921875, 0.54150390625, 0.08447265625, 0.6767578125, 1869 0.619140625, 0.392822265625 1870 ], 1871 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float16'} 1872 }, 1873 'conv2dFilter': { 1874 'data': [ 1875 0.1453857421875, 0.6953125, 0.30712890625, 0.96728515625, 1876 0.50732421875, 0.432373046875, 0.10833740234375, 0.0814208984375, 1877 0.98486328125, 0.3203125, 0.5302734375, 0.42822265625 1878 ], 1879 'descriptor': {shape: [1, 2, 2, 3], dataType: 'float16'}, 1880 'constant': true 1881 } 1882 }, 1883 'operators': [{ 1884 'name': 'conv2d', 1885 'arguments': [ 1886 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1887 {'options': {'inputLayout': 'nhwc', 'filterLayout': 'ihwo'}} 1888 ], 1889 'outputs': 'conv2dOutput' 1890 }], 1891 'expectedOutputs': { 1892 'conv2dOutput': { 1893 'data': [ 1894 0.884765625, 0.962890625, 0.8017578125, 0.7412109375, 1895 0.91064453125, 0.62744140625, 0.289794921875, 0.4833984375, 1896 0.448486328125, 0.405517578125, 0.488037109375, 0.87158203125, 1897 0.693359375, 1.1787109375, 0.9169921875, 1.037109375, 1898 0.8125, 1.0830078125, 0.82861328125, 0.81640625, 1899 1.2353515625, 0.353271484375, 0.67822265625, 0.98095703125 1900 ], 1901 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} 1902 } 1903 } 1904 } 1905 }, 1906 { 1907 'name': 'conv2d float16 4D input and filter tensors 1D options.bias', 1908 'graph': { 1909 'inputs': { 1910 'conv2dInput': { 1911 'data': [ 1912 0.7529296875, 0.751953125, 0.5947265625, 0.21630859375, 1913 0.07586669921875, 0.151123046875, 0.12127685546875, 0.53662109375, 1914 0.59375, 0.9912109375, 0.363037109375, 0.92919921875, 1915 0.227294921875, 0.54150390625, 0.08447265625, 0.6767578125, 1916 0.619140625, 0.392822265625 1917 ], 1918 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float16'} 1919 }, 1920 'conv2dFilter': { 1921 'data': [ 1922 0.1453857421875, 0.96728515625, 0.10833740234375, 0.3203125, 1923 0.6953125, 0.50732421875, 0.0814208984375, 0.5302734375, 1924 0.30712890625, 0.432373046875, 0.98486328125, 0.42822265625 1925 ], 1926 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float16'}, 1927 'constant': true 1928 }, 1929 'conv2dBias': { 1930 'data': [0.8134765625, 0.83935546875, 0.494384765625], 1931 'descriptor': {shape: [3], dataType: 'float16'}, 1932 'constant': true 1933 } 1934 }, 1935 'operators': [{ 1936 'name': 'conv2d', 1937 'arguments': [ 1938 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, 1939 {'options': {'bias': 'conv2dBias'}} 1940 ], 1941 'outputs': 'conv2dOutput' 1942 }], 1943 'expectedOutputs': { 1944 'conv2dOutput': { 1945 'data': [ 1946 1.6982421875, 1.5546875, 1.103515625, 1.21875, 1947 1.8017578125, 1.75, 1.322265625, 1.3271484375, 1948 1.2958984375, 1.1220703125, 0.94287109375, 1.3662109375, 1949 1.5068359375, 1.8505859375, 1.6416015625, 1.1669921875, 1950 2.017578125, 1.65234375, 1.6552734375, 1.517578125, 1951 1.4111328125, 1.5771484375, 1.7294921875, 1.4755859375 1952 ], 1953 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'} 1954 } 1955 } 1956 } 1957 }, 1958 { 1959 'name': 'conv2d float16 4D input and filter tensors all options', 1960 'graph': { 1961 'inputs': { 1962 'conv2dInput': { 1963 'data': [ 1964 0.0997314453125, 0.53759765625, 0.3056640625, 1965 0.72216796875, 0.5068359375, 0.32373046875, 1966 0.8720703125, 0.2098388671875, 0.50537109375, 1967 0.0268707275390625, 0.5498046875, 0.0643310546875, 1968 0.156005859375, 0.11968994140625, 0.0361328125, 1969 0.414306640625, 0.24169921875, 0.67724609375, 1970 0.208740234375, 0.10980224609375, 0.7451171875, 1971 0.744140625, 0.787109375, 0.5888671875, 1972 0.11016845703125, 0.904296875, 0.11724853515625, 1973 0.85107421875, 0.424560546875, 0.0253753662109375, 1974 0.74755859375, 0.464599609375, 0.0304107666015625, 1975 0.42431640625, 0.384765625, 0.75830078125, 1976 0.990234375, 0.03717041015625, 0.014495849609375, 1977 0.826171875, 0.210693359375, 0.65673828125, 1978 0.258544921875, 0.480224609375, 0.97021484375, 1979 0.296875, 0.75244140625, 0.029632568359375, 1980 0.09027099609375, 0.7783203125 1981 ], 1982 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 1983 }, 1984 'conv2dFilter': { 1985 'data': [ 1986 0.638671875, 0.07763671875, 0.129150390625, 0.456298828125, 1987 0.404296875, 0.59423828125, 0.1424560546875, 0.90380859375 1988 ], 1989 'descriptor': {shape: [2, 2, 1, 2], dataType: 'float16'}, 1990 'constant': true 1991 }, 1992 'conv2dBias': { 1993 'data': [0.54248046875, 0.8408203125], 1994 'descriptor': {shape: [2], dataType: 'float16'}, 1995 'constant': true 1996 } 1997 }, 1998 'operators': [{ 1999 'name': 'conv2d', 2000 'arguments': [ 2001 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, { 2002 'options': { 2003 'padding': [1, 0, 0, 1], 2004 'strides': [1, 1], 2005 'dilations': [1, 1], 2006 'groups': 2, 2007 'inputLayout': 'nchw', 2008 'filterLayout': 'hwio', 2009 'bias': 'conv2dBias' 2010 } 2011 } 2012 ], 2013 'outputs': 'conv2dOutput' 2014 }], 2015 'expectedOutputs': { 2016 'conv2dOutput': { 2017 'data': [ 2018 0.6591796875, 0.80322265625, 0.76904296875, 0.90673828125, 2019 0.74755859375, 0.9306640625, 1.3076171875, 0.98779296875, 2020 1.27734375, 0.876953125, 1.09375, 1.1748046875, 2021 0.82177734375, 0.92236328125, 0.57421875, 1.103515625, 2022 0.7978515625, 0.9609375, 0.7236328125, 0.60986328125, 2023 1.2451171875, 1.197265625, 1.404296875, 0.94384765625, 2024 0.6572265625, 1.484375, 1.6796875, 1.73046875, 2025 1.1162109375, 0.85595703125, 1.8291015625, 1.5419921875, 2026 1.501953125, 1.4853515625, 1.0712890625, 2.45703125, 2027 1.5126953125, 1.072265625, 1.8046875, 1.361328125, 2028 2.0703125, 1.55859375, 1.4384765625, 2.380859375, 2029 1.4814453125, 2.013671875, 1.4833984375, 1.1796875, 2030 2.078125, 1.37890625 2031 ], 2032 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 2033 } 2034 } 2035 } 2036 }, 2037 { 2038 'name': 2039 'conv2d float16 4D input and filter tensors, both negative input tensor and options.bias', 2040 'graph': { 2041 'inputs': { 2042 'conv2dInput': { 2043 'data': [ 2044 -0.80712890625, -0.8837890625, -0.77001953125, 2045 -0.564453125, -0.397216796875, -0.1083984375, 2046 -0.5517578125, -0.3955078125, -0.057586669921875, 2047 -0.5146484375, -0.2132568359375, -0.95068359375, 2048 -0.80419921875, -0.86474609375, -0.9609375, 2049 -0.326416015625, -0.06884765625, -0.3203125, 2050 -0.269287109375, -0.343017578125, -0.89892578125, 2051 -0.90380859375, -0.63671875, -0.20068359375, 2052 -0.787109375, -0.3466796875, -0.060028076171875, 2053 -0.14990234375, -0.6484375, -0.8935546875, 2054 -0.81494140625, -0.642578125, -0.032745361328125, 2055 -0.6611328125, -0.58447265625, -0.09918212890625, 2056 -0.166015625, -0.95068359375, -0.30517578125, 2057 -0.62109375, -0.5400390625, -0.420166015625, 2058 -0.188232421875, -0.35888671875, -0.71142578125, 2059 -0.375, -0.7109375, -0.360595703125, 2060 -0.546875, -0.032257080078125 2061 ], 2062 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 2063 }, 2064 'conv2dFilter': { 2065 'data': [ 2066 0.638671875, 0.07763671875, 0.129150390625, 0.456298828125, 2067 0.404296875, 0.59423828125, 0.1424560546875, 0.90380859375 2068 ], 2069 'descriptor': {shape: [2, 2, 1, 2], dataType: 'float16'}, 2070 'constant': true 2071 }, 2072 'conv2dBias': { 2073 'data': [-0.375, -0.436279296875], 2074 'descriptor': {shape: [2], dataType: 'float16'}, 2075 'constant': true 2076 } 2077 }, 2078 'operators': [{ 2079 'name': 'conv2d', 2080 'arguments': [ 2081 {'input': 'conv2dInput'}, {'filter': 'conv2dFilter'}, { 2082 'options': { 2083 'padding': [1, 0, 0, 1], 2084 'groups': 2, 2085 'filterLayout': 'hwio', 2086 'bias': 'conv2dBias' 2087 } 2088 } 2089 ], 2090 'outputs': 'conv2dOutput' 2091 }], 2092 'expectedOutputs': { 2093 'conv2dOutput': { 2094 'data': [ 2095 -0.8271484375, -0.841796875, -0.7666015625, -0.65966796875, 2096 -0.53564453125, -1.126953125, -1.318359375, -1.107421875, 2097 -0.88330078125, -0.8369140625, -0.7373046875, -1.27734375, 2098 -1.0830078125, -0.96484375, -1.091796875, -0.77587890625, 2099 -1.1591796875, -1.16796875, -1.208984375, -1.126953125, 2100 -1.0849609375, -0.91650390625, -0.900390625, -0.78466796875, 2101 -0.912109375, -0.69677734375, -0.607421875, -1.111328125, 2102 -1.62890625, -0.96728515625, -1.5556640625, -0.9208984375, 2103 -1.3603515625, -1.8154296875, -0.85302734375, -1.001953125, 2104 -1.458984375, -1.5810546875, -1.4970703125, -0.8505859375, 2105 -1.220703125, -1.302734375, -1.0859375, -1.599609375, 2106 -0.9072265625, -1.53515625, -1.302734375, -1.3232421875, 2107 -1.142578125, -0.5107421875 2108 ], 2109 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float16'} 2110 } 2111 } 2112 } 2113 } 2114 ]; 2115 2116 webnn_conformance_test( 2117 conv2dTests, buildAndExecuteGraph, getPrecisionTolerance);