tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

batch_normalization.https.any.js (48344B)


      1 // META: title=test WebNN API batchNormalization 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-batchnorm
     12 // Normalize the values of the input tensor using Batch-Normalization.
     13 //
     14 // dictionary MLBatchNormalizationOptions {
     15 //   MLOperand scale;
     16 //   MLOperand bias;
     17 //   [EnforceRange] unsigned long axis = 1;
     18 //   double epsilon = 1e-5;
     19 // };
     20 //
     21 // MLOperand batchNormalization(
     22 //     MLOperand input, MLOperand mean, MLOperand, variance,
     23 //     optional MLBatchNormalizationOptions options = {});
     24 
     25 const batchNormTests = [
     26  {
     27    'name': 'batchNormalization float32 1D tensor options.axis=0',
     28    'graph': {
     29      'inputs': {
     30        'bnInput': {
     31          'data': [
     32            -41.30733108520508,  64.08863830566406, -63.376670837402344,
     33            -46.790367126464844, 83.02227020263672, -80.08049011230469
     34          ],
     35          'descriptor': {shape: [6], dataType: 'float32'}
     36        },
     37        'bnMean': {
     38          'data': [
     39            -7.814267635345459, -95.64129638671875, 38.15440368652344,
     40            -55.95203399658203, -87.86500549316406, -41.63645553588867
     41          ],
     42          'descriptor': {shape: [6], dataType: 'float32'},
     43          'constant': true
     44        },
     45        'bnVariance': {
     46          'data': [
     47            60.31186294555664,  26.43260383605957, 53.275634765625,
     48            40.146121978759766, 59.41098403930664, 35.99981689453125
     49          ],
     50          'descriptor': {shape: [6], dataType: 'float32'},
     51          'constant': true
     52        }
     53      },
     54      'operators': [{
     55        'name': 'batchNormalization',
     56        'arguments': [
     57          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
     58          {'options': {'axis': 0}}
     59        ],
     60        'outputs': 'bnOutput'
     61      }],
     62      'expectedOutputs': {
     63        'bnOutput': {
     64          'data': [
     65            -4.312741756439209, 31.068212509155273, -13.910240173339844,
     66            1.4459478855133057, 22.170541763305664, -6.407354354858398
     67          ],
     68          'descriptor': {shape: [6], dataType: 'float32'}
     69        }
     70      }
     71    }
     72  },
     73  {
     74    'name':
     75        'batchNormalization float32 2D tensor (mean and variance are non-constant) default options',
     76    'graph': {
     77      'inputs': {
     78        'bnInput': {
     79          'data': [
     80            -41.30733108520508,  64.08863830566406,    -63.376670837402344,
     81            -46.790367126464844, 83.02227020263672,    -80.08049011230469,
     82            -62.144378662109375, -0.10012771934270859, -40.90216064453125,
     83            56.96306228637695,   37.37249755859375,    57.046478271484375,
     84            82.05680084228516,   -86.1164321899414,    76.8831787109375,
     85            97.03362274169922,   -21.35103988647461,   -96.93824005126953,
     86            -9.359310150146484,  80.20824432373047,    -85.36802673339844,
     87            62.35185241699219,   -68.4724349975586,    -12.10716724395752
     88          ],
     89          'descriptor': {shape: [4, 6], dataType: 'float32'}
     90        },
     91        'bnMean': {
     92          'data': [
     93            -7.814267635345459, -95.64129638671875, 38.15440368652344,
     94            -55.95203399658203, -87.86500549316406, -41.63645553588867
     95          ],
     96          'descriptor': {shape: [6], dataType: 'float32'}
     97        },
     98        'bnVariance': {
     99          'data': [
    100            60.31186294555664, 26.43260383605957, 53.275634765625,
    101            40.146121978759766, 59.41098403930664, 35.99981689453125
    102          ],
    103          'descriptor': {shape: [6], dataType: 'float32'}
    104        }
    105      },
    106      'operators': [{
    107        'name': 'batchNormalization',
    108        'arguments': [
    109          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'}
    110        ],
    111        'outputs': 'bnOutput'
    112      }],
    113      'expectedOutputs': {
    114        'bnOutput': {
    115          'data': [
    116            -4.312741756439209,  31.068212509155273, -13.910240173339844,
    117            1.4459478855133057,  22.170541763305664, -6.407354354858398,
    118            -6.995829105377197,  18.583200454711914, -10.831125259399414,
    119            17.820920944213867,  16.2480411529541,   16.447195053100586,
    120            11.57226848602295,   1.8526301383972168, 5.306026458740234,
    121            24.145092010498047,  8.629376411437988,  -9.216986656188965,
    122            -0.1989477425813675, 34.203548431396484, -16.923160552978516,
    123            18.671411514282227,  2.5159497261047363, 4.921559810638428
    124          ],
    125          'descriptor': {shape: [4, 6], dataType: 'float32'}
    126        }
    127      }
    128    }
    129  },
    130  {
    131    'name': 'batchNormalization float32 2D tensor default options',
    132    'graph': {
    133      'inputs': {
    134        'bnInput': {
    135          'data': [
    136            -41.30733108520508,  64.08863830566406,    -63.376670837402344,
    137            -46.790367126464844, 83.02227020263672,    -80.08049011230469,
    138            -62.144378662109375, -0.10012771934270859, -40.90216064453125,
    139            56.96306228637695,   37.37249755859375,    57.046478271484375,
    140            82.05680084228516,   -86.1164321899414,    76.8831787109375,
    141            97.03362274169922,   -21.35103988647461,   -96.93824005126953,
    142            -9.359310150146484,  80.20824432373047,    -85.36802673339844,
    143            62.35185241699219,   -68.4724349975586,    -12.10716724395752
    144          ],
    145          'descriptor': {shape: [4, 6], dataType: 'float32'}
    146        },
    147        'bnMean': {
    148          'data': [
    149            -7.814267635345459, -95.64129638671875, 38.15440368652344,
    150            -55.95203399658203, -87.86500549316406, -41.63645553588867
    151          ],
    152          'descriptor': {shape: [6], dataType: 'float32'},
    153          'constant': true
    154        },
    155        'bnVariance': {
    156          'data': [
    157            60.31186294555664, 26.43260383605957, 53.275634765625,
    158            40.146121978759766, 59.41098403930664, 35.99981689453125
    159          ],
    160          'descriptor': {shape: [6], dataType: 'float32'},
    161          'constant': true
    162        }
    163      },
    164      'operators': [{
    165        'name': 'batchNormalization',
    166        'arguments': [
    167          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'}
    168        ],
    169        'outputs': 'bnOutput'
    170      }],
    171      'expectedOutputs': {
    172        'bnOutput': {
    173          'data': [
    174            -4.312741756439209,  31.068212509155273, -13.910240173339844,
    175            1.4459478855133057,  22.170541763305664, -6.407354354858398,
    176            -6.995829105377197,  18.583200454711914, -10.831125259399414,
    177            17.820920944213867,  16.2480411529541,   16.447195053100586,
    178            11.57226848602295,   1.8526301383972168, 5.306026458740234,
    179            24.145092010498047,  8.629376411437988,  -9.216986656188965,
    180            -0.1989477425813675, 34.203548431396484, -16.923160552978516,
    181            18.671411514282227,  2.5159497261047363, 4.921559810638428
    182          ],
    183          'descriptor': {shape: [4, 6], dataType: 'float32'}
    184        }
    185      }
    186    }
    187  },
    188  {
    189    'name': 'batchNormalization float32 3D tensor default options',
    190    'graph': {
    191      'inputs': {
    192        'bnInput': {
    193          'data': [
    194            -41.30733108520508,  64.08863830566406,    -63.376670837402344,
    195            -46.790367126464844, 83.02227020263672,    -80.08049011230469,
    196            -62.144378662109375, -0.10012771934270859, -40.90216064453125,
    197            56.96306228637695,   37.37249755859375,    57.046478271484375,
    198            82.05680084228516,   -86.1164321899414,    76.8831787109375,
    199            97.03362274169922,   -21.35103988647461,   -96.93824005126953,
    200            -9.359310150146484,  80.20824432373047,    -85.36802673339844,
    201            62.35185241699219,   -68.4724349975586,    -12.10716724395752
    202          ],
    203          'descriptor': {shape: [2, 3, 4], dataType: 'float32'}
    204        },
    205        'bnMean': {
    206          'data': [12.810380935668945, 63.13715362548828, -61.62983322143555],
    207          'descriptor': {shape: [3], dataType: 'float32'},
    208          'constant': true
    209        },
    210        'bnVariance': {
    211          'data': [18.358240127563477, 41.847232818603516, 16.12828254699707],
    212          'descriptor': {shape: [3], dataType: 'float32'},
    213          'constant': true
    214        }
    215      },
    216      'operators': [{
    217        'name': 'batchNormalization',
    218        'arguments': [
    219          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'}
    220        ],
    221        'outputs': 'bnOutput'
    222      }],
    223      'expectedOutputs': {
    224        'bnOutput': {
    225          'data': [
    226            -12.630594253540039, 11.967890739440918,  -17.781383514404297,
    227            -13.910285949707031, 3.0739352703094482,  -22.139259338378906,
    228            -19.36661148071289,  -9.775517463684082,  5.161267280578613,
    229            29.53006935119629,   24.651947021484375,  29.550840377807617,
    230            16.161500930786133,  -23.088642120361328, 14.954023361206055,
    231            19.656957626342773,  -13.06058406829834,  -24.745210647583008,
    232            -11.206846237182617, 2.638929843902588,   -5.910898208618164,
    233            30.871898651123047,  -1.7038332223892212, 12.331327438354492
    234          ],
    235          'descriptor': {shape: [2, 3, 4], dataType: 'float32'}
    236        }
    237      }
    238    }
    239  },
    240  {
    241    'name': 'batchNormalization float32 4D tensor default options',
    242    'graph': {
    243      'inputs': {
    244        'bnInput': {
    245          'data': [
    246            -41.30733108520508,  64.08863830566406,    -63.376670837402344,
    247            -46.790367126464844, 83.02227020263672,    -80.08049011230469,
    248            -62.144378662109375, -0.10012771934270859, -40.90216064453125,
    249            56.96306228637695,   37.37249755859375,    57.046478271484375,
    250            82.05680084228516,   -86.1164321899414,    76.8831787109375,
    251            97.03362274169922,   -21.35103988647461,   -96.93824005126953,
    252            -9.359310150146484,  80.20824432373047,    -85.36802673339844,
    253            62.35185241699219,   -68.4724349975586,    -12.10716724395752
    254          ],
    255          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'}
    256        },
    257        'bnMean': {
    258          'data': [51.629150390625, 99.36075592041016, -96.1473617553711],
    259          'descriptor': {shape: [3], dataType: 'float32'},
    260          'constant': true
    261        },
    262        'bnVariance': {
    263          'data': [30.448015213012695, 86.36219024658203, 73.88455200195312],
    264          'descriptor': {shape: [3], dataType: 'float32'},
    265          'constant': true
    266        }
    267      },
    268      'operators': [{
    269        'name': 'batchNormalization',
    270        'arguments': [
    271          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'}
    272        ],
    273        'outputs': 'bnOutput'
    274      }],
    275      'expectedOutputs': {
    276        'bnOutput': {
    277          'data': [
    278            -16.842504501342773, 2.2579827308654785,  -20.842041015625,
    279            -17.836172103881836, -1.7581257820129395, -19.30902862548828,
    280            -17.37898826599121,  -10.702629089355469, 6.4271392822265625,
    281            17.812623977661133,  15.533489227294922,  17.822328567504883,
    282            5.514280319213867,   -24.963077545166016, 4.576685905456543,
    283            8.228469848632812,   -12.989363670349121, -21.123029708862305,
    284            -11.698976516723633, -2.0609331130981445, 1.2540507316589355,
    285            18.43954849243164,   3.2196571826934814,  9.777103424072266
    286          ],
    287          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'}
    288        }
    289      }
    290    }
    291  },
    292  {
    293    'name': 'batchNormalization float32 5D tensor default options',
    294    'graph': {
    295      'inputs': {
    296        'bnInput': {
    297          'data': [
    298            -41.30733108520508,  64.08863830566406,    -63.376670837402344,
    299            -46.790367126464844, 83.02227020263672,    -80.08049011230469,
    300            -62.144378662109375, -0.10012771934270859, -40.90216064453125,
    301            56.96306228637695,   37.37249755859375,    57.046478271484375,
    302            82.05680084228516,   -86.1164321899414,    76.8831787109375,
    303            97.03362274169922,   -21.35103988647461,   -96.93824005126953,
    304            -9.359310150146484,  80.20824432373047,    -85.36802673339844,
    305            62.35185241699219,   -68.4724349975586,    -12.10716724395752
    306          ],
    307          'descriptor': {shape: [6, 1, 1, 2, 2], dataType: 'float32'}
    308        },
    309        'bnMean': {
    310          'data': [35.4078254699707],
    311          'descriptor': {shape: [1], dataType: 'float32'},
    312          'constant': true
    313        },
    314        'bnVariance': {
    315          'data': [40.93109893798828],
    316          'descriptor': {shape: [1], dataType: 'float32'},
    317          'constant': true
    318        }
    319      },
    320      'operators': [{
    321        'name': 'batchNormalization',
    322        'arguments': [
    323          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'}
    324        ],
    325        'outputs': 'bnOutput'
    326      }],
    327      'expectedOutputs': {
    328        'bnOutput': {
    329          'data': [
    330            -11.990972518920898, 4.4829583168029785,  -15.440524101257324,
    331            -12.847999572753906, 7.442382335662842,   -18.051416397094727,
    332            -15.247910499572754, -5.550075531005859,  -11.927642822265625,
    333            3.369194269180298,   0.30708834528923035, 3.382232427597046,
    334            7.291474342346191,   -18.99486541748047,  6.4828104972839355,
    335            9.632428169250488,   -8.871702194213867,  -20.686368942260742,
    336            -6.99733304977417,   7.002535343170166,   -18.877885818481445,
    337            4.211489677429199,   -16.237018585205078, -7.42683744430542
    338          ],
    339          'descriptor': {shape: [6, 1, 1, 2, 2], dataType: 'float32'}
    340        }
    341      }
    342    }
    343  },
    344  {
    345    'name': 'batchNormalization float32 4D NCHW tensor options.axis=1',
    346    'graph': {
    347      'inputs': {
    348        'bnInput': {
    349          'data': [
    350            -41.30733108520508,  64.08863830566406,    -63.376670837402344,
    351            -46.790367126464844, 83.02227020263672,    -80.08049011230469,
    352            -62.144378662109375, -0.10012771934270859, -40.90216064453125,
    353            56.96306228637695,   37.37249755859375,    57.046478271484375,
    354            82.05680084228516,   -86.1164321899414,    76.8831787109375,
    355            97.03362274169922,   -21.35103988647461,   -96.93824005126953,
    356            -9.359310150146484,  80.20824432373047,    -85.36802673339844,
    357            62.35185241699219,   -68.4724349975586,    -12.10716724395752
    358          ],
    359          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'}
    360        },
    361        'bnMean': {
    362          'data': [51.629150390625, 99.36075592041016, -96.1473617553711],
    363          'descriptor': {shape: [3], dataType: 'float32'},
    364          'constant': true
    365        },
    366        'bnVariance': {
    367          'data': [30.448015213012695, 86.36219024658203, 73.88455200195312],
    368          'descriptor': {shape: [3], dataType: 'float32'},
    369          'constant': true
    370        }
    371      },
    372      'operators': [{
    373        'name': 'batchNormalization',
    374        'arguments': [
    375          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
    376          {'options': {'axis': 1}}
    377        ],
    378        'outputs': 'bnOutput'
    379      }],
    380      'expectedOutputs': {
    381        'bnOutput': {
    382          'data': [
    383            -16.842504501342773, 2.2579827308654785,  -20.842041015625,
    384            -17.836172103881836, -1.7581257820129395, -19.30902862548828,
    385            -17.37898826599121,  -10.702629089355469, 6.4271392822265625,
    386            17.812623977661133,  15.533489227294922,  17.822328567504883,
    387            5.514280319213867,   -24.963077545166016, 4.576685905456543,
    388            8.228469848632812,   -12.989363670349121, -21.123029708862305,
    389            -11.698976516723633, -2.0609331130981445, 1.2540507316589355,
    390            18.43954849243164,   3.2196571826934814,  9.777103424072266
    391          ],
    392          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'}
    393        }
    394      }
    395    }
    396  },
    397  {
    398    'name': 'batchNormalization float32 4D NHWC tensor options.axis=3',
    399    'graph': {
    400      'inputs': {
    401        'bnInput': {
    402          'data': [
    403            -41.30733108520508,  83.02227020263672,    -40.90216064453125,
    404            64.08863830566406,   -80.08049011230469,   56.96306228637695,
    405            -63.376670837402344, -62.144378662109375,  37.37249755859375,
    406            -46.790367126464844, -0.10012771934270859, 57.046478271484375,
    407            82.05680084228516,   -21.35103988647461,   -85.36802673339844,
    408            -86.1164321899414,   -96.93824005126953,   62.35185241699219,
    409            76.8831787109375,    -9.359310150146484,   -68.4724349975586,
    410            97.03362274169922,   80.20824432373047,    -12.10716724395752
    411          ],
    412          'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}
    413        },
    414        'bnMean': {
    415          'data': [51.629150390625, 99.36075592041016, -96.1473617553711],
    416          'descriptor': {shape: [3], dataType: 'float32'},
    417          'constant': true
    418        },
    419        'bnVariance': {
    420          'data': [30.448015213012695, 86.36219024658203, 73.88455200195312],
    421          'descriptor': {shape: [3], dataType: 'float32'},
    422          'constant': true
    423        }
    424      },
    425      'operators': [{
    426        'name': 'batchNormalization',
    427        'arguments': [
    428          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
    429          {'options': {'axis': 3}}
    430        ],
    431        'outputs': 'bnOutput'
    432      }],
    433      'expectedOutputs': {
    434        'bnOutput': {
    435          'data': [
    436            -16.842504501342773, -1.7581257820129395, 6.4271392822265625,
    437            2.2579827308654785,  -19.30902862548828,  17.812623977661133,
    438            -20.842041015625,    -17.37898826599121,  15.533489227294922,
    439            -17.836172103881836, -10.702629089355469, 17.822328567504883,
    440            5.514280319213867,   -12.989363670349121, 1.2540507316589355,
    441            -24.963077545166016, -21.123029708862305, 18.43954849243164,
    442            4.576685905456543,   -11.698976516723633, 3.2196571826934814,
    443            8.228469848632812,   -2.0609331130981445, 9.777103424072266
    444          ],
    445          'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}
    446        }
    447      }
    448    }
    449  },
    450  {
    451    'name': 'batchNormalization float32 4D NCHW tensor options.scale',
    452    'graph': {
    453      'inputs': {
    454        'bnInput': {
    455          'data': [
    456            -41.30733108520508,  64.08863830566406,    -63.376670837402344,
    457            -46.790367126464844, 83.02227020263672,    -80.08049011230469,
    458            -62.144378662109375, -0.10012771934270859, -40.90216064453125,
    459            56.96306228637695,   37.37249755859375,    57.046478271484375,
    460            82.05680084228516,   -86.1164321899414,    76.8831787109375,
    461            97.03362274169922,   -21.35103988647461,   -96.93824005126953,
    462            -9.359310150146484,  80.20824432373047,    -85.36802673339844,
    463            62.35185241699219,   -68.4724349975586,    -12.10716724395752
    464          ],
    465          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'}
    466        },
    467        'bnMean': {
    468          'data': [51.629150390625, 99.36075592041016, -96.1473617553711],
    469          'descriptor': {shape: [3], dataType: 'float32'},
    470          'constant': true
    471        },
    472        'bnVariance': {
    473          'data': [30.448015213012695, 86.36219024658203, 73.88455200195312],
    474          'descriptor': {shape: [3], dataType: 'float32'},
    475          'constant': true
    476        },
    477        'bnScale': {
    478          'data': [65.50171661376953, -71.007568359375, -5.569730758666992],
    479          'descriptor': {shape: [3], dataType: 'float32'},
    480          'constant': true
    481        }
    482      },
    483      'operators': [{
    484        'name': 'batchNormalization',
    485        'arguments': [
    486          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
    487          {'options': {'scale': 'bnScale'}}
    488        ],
    489        'outputs': 'bnOutput'
    490      }],
    491      'expectedOutputs': {
    492        'bnOutput': {
    493          'data': [
    494            -1103.212890625,     147.90174865722656,  -1365.189453125,
    495            -1168.2999267578125, 124.84024047851562,  1371.087158203125,
    496            1234.0396728515625,  759.9676513671875,   -35.79743576049805,
    497            -99.2115249633789,   -86.51734924316406,  -99.26557159423828,
    498            361.19482421875,     -1635.1243896484375, 299.78076171875,
    499            538.9788818359375,   922.3430786132812,   1499.89501953125,
    500            830.7158813476562,   146.3418426513672,   -6.984724998474121,
    501            -102.70331573486328, -17.9326229095459,   -54.455833435058594
    502          ],
    503          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'}
    504        }
    505      }
    506    }
    507  },
    508  {
    509    'name': 'batchNormalization float32 4D NCHW tensor options.bias',
    510    'graph': {
    511      'inputs': {
    512        'bnInput': {
    513          'data': [
    514            -41.30733108520508,  64.08863830566406,    -63.376670837402344,
    515            -46.790367126464844, 83.02227020263672,    -80.08049011230469,
    516            -62.144378662109375, -0.10012771934270859, -40.90216064453125,
    517            56.96306228637695,   37.37249755859375,    57.046478271484375,
    518            82.05680084228516,   -86.1164321899414,    76.8831787109375,
    519            97.03362274169922,   -21.35103988647461,   -96.93824005126953,
    520            -9.359310150146484,  80.20824432373047,    -85.36802673339844,
    521            62.35185241699219,   -68.4724349975586,    -12.10716724395752
    522          ],
    523          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'}
    524        },
    525        'bnMean': {
    526          'data': [51.629150390625, 99.36075592041016, -96.1473617553711],
    527          'descriptor': {shape: [3], dataType: 'float32'},
    528          'constant': true
    529        },
    530        'bnVariance': {
    531          'data': [30.448015213012695, 86.36219024658203, 73.88455200195312],
    532          'descriptor': {shape: [3], dataType: 'float32'},
    533          'constant': true
    534        },
    535        'bnBias': {
    536          'data': [64.2044677734375, 75.28591918945312, -84.57243347167969],
    537          'descriptor': {shape: [3], dataType: 'float32'},
    538          'constant': true
    539        }
    540      },
    541      'operators': [{
    542        'name': 'batchNormalization',
    543        'arguments': [
    544          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
    545          {'options': {'bias': 'bnBias'}}
    546        ],
    547        'outputs': 'bnOutput'
    548      }],
    549      'expectedOutputs': {
    550        'bnOutput': {
    551          'data': [
    552            47.36196517944336,  66.46244812011719,  43.3624267578125,
    553            46.36829376220703,  73.52779388427734,  55.976890563964844,
    554            57.90693283081055,  64.58329010009766,  -78.14529418945312,
    555            -66.75981140136719, -69.03894805908203, -66.75010681152344,
    556            69.71875,           39.241390228271484, 68.7811508178711,
    557            72.43293762207031,  62.29655456542969,  54.16288757324219,
    558            63.586944580078125, 73.22498321533203,  -83.3183822631836,
    559            -66.13288879394531, -81.35277557373047, -74.79533386230469
    560          ],
    561          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'}
    562        }
    563      }
    564    }
    565  },
    566  {
    567    'name': 'batchNormalization float32 4D NCHW tensor options.epsilon',
    568    'graph': {
    569      'inputs': {
    570        'bnInput': {
    571          'data': [
    572            -41.30733108520508,  64.08863830566406,    -63.376670837402344,
    573            -46.790367126464844, 83.02227020263672,    -80.08049011230469,
    574            -62.144378662109375, -0.10012771934270859, -40.90216064453125,
    575            56.96306228637695,   37.37249755859375,    57.046478271484375,
    576            82.05680084228516,   -86.1164321899414,    76.8831787109375,
    577            97.03362274169922,   -21.35103988647461,   -96.93824005126953,
    578            -9.359310150146484,  80.20824432373047,    -85.36802673339844,
    579            62.35185241699219,   -68.4724349975586,    -12.10716724395752
    580          ],
    581          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'}
    582        },
    583        'bnMean': {
    584          'data': [51.629150390625, 99.36075592041016, -96.1473617553711],
    585          'descriptor': {shape: [3], dataType: 'float32'},
    586          'constant': true
    587        },
    588        'bnVariance': {
    589          'data': [30.448015213012695, 86.36219024658203, 73.88455200195312],
    590          'descriptor': {shape: [3], dataType: 'float32'},
    591          'constant': true
    592        }
    593      },
    594      'operators': [{
    595        'name': 'batchNormalization',
    596        'arguments': [
    597          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
    598          {'options': {'epsilon': 0.000001}}
    599        ],
    600        'outputs': 'bnOutput'
    601      }],
    602      'expectedOutputs': {
    603        'bnOutput': {
    604          'data': [
    605            -16.842506408691406, 2.2579832077026367,  -20.842044830322266,
    606            -17.8361759185791,   -1.758125901222229,  -19.309030532836914,
    607            -17.37898826599121,  -10.702629089355469, 6.427139759063721,
    608            17.812625885009766,  15.533490180969238,  17.822330474853516,
    609            5.514281272888184,   -24.96308135986328,  4.576686382293701,
    610            8.228470802307129,   -12.989363670349121, -21.123031616210938,
    611            -11.698976516723633, -2.0609331130981445, 1.254050850868225,
    612            18.43954849243164,   3.2196574211120605,  9.777103424072266
    613          ],
    614          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'}
    615        }
    616      }
    617    }
    618  },
    619  {
    620    'name': 'batchNormalization float32 4D NHWC tensor all options',
    621    'graph': {
    622      'inputs': {
    623        'bnInput': {
    624          'data': [
    625            -41.30733108520508,  83.02227020263672,    -40.90216064453125,
    626            64.08863830566406,   -80.08049011230469,   56.96306228637695,
    627            -63.376670837402344, -62.144378662109375,  37.37249755859375,
    628            -46.790367126464844, -0.10012771934270859, 57.046478271484375,
    629            82.05680084228516,   -21.35103988647461,   -85.36802673339844,
    630            -86.1164321899414,   -96.93824005126953,   62.35185241699219,
    631            76.8831787109375,    -9.359310150146484,   -68.4724349975586,
    632            97.03362274169922,   80.20824432373047,    -12.10716724395752
    633          ],
    634          'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}
    635        },
    636        'bnMean': {
    637          'data': [51.629150390625, 99.36075592041016, -96.1473617553711],
    638          'descriptor': {shape: [3], dataType: 'float32'},
    639          'constant': true
    640        },
    641        'bnVariance': {
    642          'data': [30.448015213012695, 86.36219024658203, 73.88455200195312],
    643          'descriptor': {shape: [3], dataType: 'float32'},
    644          'constant': true
    645        },
    646        'bnScale': {
    647          'data': [65.50171661376953, -71.007568359375, -5.569730758666992],
    648          'descriptor': {shape: [3], dataType: 'float32'},
    649          'constant': true
    650        },
    651        'bnBias': {
    652          'data': [64.2044677734375, 75.28591918945312, -84.57243347167969],
    653          'descriptor': {shape: [3], dataType: 'float32'},
    654          'constant': true
    655        }
    656      },
    657      'operators': [{
    658        'name': 'batchNormalization',
    659        'arguments': [
    660          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
    661          {
    662            'options': {
    663              'scale': 'bnScale',
    664              'bias': 'bnBias',
    665              'axis': 3,
    666              'epsilon': 0.000001
    667            }
    668          }
    669        ],
    670        'outputs': 'bnOutput'
    671      }],
    672      'expectedOutputs': {
    673        'bnOutput': {
    674          'data': [
    675            -1039.0085734071204, 200.12613597546277, -120.36987167541395,
    676            212.10626540432202,  1446.3732126569944, -183.78396479879416,
    677            -1300.9852072279227, 1309.3257094058545, -171.08979404258523,
    678            -1104.0956031373803, 835.2536189871761,  -183.83801576309426,
    679            425.3993215144054,   997.6290832897452,  -91.55716013805052,
    680            -1570.920072497096,  1575.1810627320297, -187.2757593197739,
    681            363.98524710447384,  906.0018322105,     -102.5050592863526,
    682            603.1834043179756,   221.6277675074517,  -139.02827100419768
    683          ],
    684          'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}
    685        }
    686      }
    687    }
    688  },
    689 
    690  // float16 tests
    691  {
    692    'name': 'batchNormalization float16 1D tensor options.axis=0',
    693    'graph': {
    694      'inputs': {
    695        'bnInput': {
    696          'data': [-41.3125, 64.0625, -63.375, -46.78125, 83, -80.0625],
    697          'descriptor': {shape: [6], dataType: 'float16'}
    698        },
    699        'bnMean': {
    700          'data': [-7.8125, -95.625, 38.15625, -55.9375, -87.875, -41.625],
    701          'descriptor': {shape: [6], dataType: 'float16'},
    702          'constant': true
    703        },
    704        'bnVariance': {
    705          'data': [60.3125, 26.4375, 53.28125, 40.15625, 59.40625, 36],
    706          'descriptor': {shape: [6], dataType: 'float16'},
    707          'constant': true
    708        }
    709      },
    710      'operators': [{
    711        'name': 'batchNormalization',
    712        'arguments': [
    713          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
    714          {'options': {'axis': 0}}
    715        ],
    716        'outputs': 'bnOutput'
    717      }],
    718      'expectedOutputs': {
    719        'bnOutput': {
    720          'data': [-4.3125, 31.0625, -13.90625, 1.4453125, 22.171875, -6.40625],
    721          'descriptor': {shape: [6], dataType: 'float16'}
    722        }
    723      }
    724    }
    725  },
    726  {
    727    'name':
    728        'batchNormalization float16 2D tensor (mean and variance are non-constant) default options',
    729    'graph': {
    730      'inputs': {
    731        'bnInput': {
    732          'data': [
    733            -41.3125, 64.0625,   -63.375,        -46.78125, 83,
    734            -80.0625, -62.15625, -0.10009765625, -40.90625, 56.96875,
    735            37.375,   57.03125,  82.0625,        -86.125,   76.875,
    736            97.0625,  -21.34375, -96.9375,       -9.359375, 80.1875,
    737            -85.375,  62.34375,  -68.5,          -12.109375
    738          ],
    739          'descriptor': {shape: [4, 6], dataType: 'float16'}
    740        },
    741        'bnMean': {
    742          'data': [-7.8125, -95.625, 38.15625, -55.9375, -87.875, -41.625],
    743          'descriptor': {shape: [6], dataType: 'float16'}
    744        },
    745        'bnVariance': {
    746          'data': [60.3125, 26.4375, 53.28125, 40.15625, 59.40625, 36],
    747          'descriptor': {shape: [6], dataType: 'float16'}
    748        }
    749      },
    750      'operators': [{
    751        'name': 'batchNormalization',
    752        'arguments': [
    753          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'}
    754        ],
    755        'outputs': 'bnOutput'
    756      }],
    757      'expectedOutputs': {
    758        'bnOutput': {
    759          'data': [
    760            -4.3125,    31.0625,     -13.90625,   1.4453125,   22.171875,
    761            -6.40625,   -6.99609375, 18.578125,   -10.828125,  17.8125,
    762            16.25,      16.4375,     11.5703125,  1.84765625,  5.3046875,
    763            24.140625,  8.6328125,   -9.21875,    -0.19921875, 34.1875,
    764            -16.921875, 18.671875,   2.513671875, 4.91796875
    765          ],
    766          'descriptor': {shape: [4, 6], dataType: 'float16'}
    767        }
    768      }
    769    }
    770  },
    771  {
    772    'name': 'batchNormalization float16 2D tensor default options',
    773    'graph': {
    774      'inputs': {
    775        'bnInput': {
    776          'data': [
    777            -41.3125, 64.0625,   -63.375,        -46.78125, 83,
    778            -80.0625, -62.15625, -0.10009765625, -40.90625, 56.96875,
    779            37.375,   57.03125,  82.0625,        -86.125,   76.875,
    780            97.0625,  -21.34375, -96.9375,       -9.359375, 80.1875,
    781            -85.375,  62.34375,  -68.5,          -12.109375
    782          ],
    783          'descriptor': {shape: [4, 6], dataType: 'float16'}
    784        },
    785        'bnMean': {
    786          'data': [-7.8125, -95.625, 38.15625, -55.9375, -87.875, -41.625],
    787          'descriptor': {shape: [6], dataType: 'float16'},
    788          'constant': true
    789        },
    790        'bnVariance': {
    791          'data': [60.3125, 26.4375, 53.28125, 40.15625, 59.40625, 36],
    792          'descriptor': {shape: [6], dataType: 'float16'},
    793          'constant': true
    794        }
    795      },
    796      'operators': [{
    797        'name': 'batchNormalization',
    798        'arguments': [
    799          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'}
    800        ],
    801        'outputs': 'bnOutput'
    802      }],
    803      'expectedOutputs': {
    804        'bnOutput': {
    805          'data': [
    806            -4.3125,    31.0625,     -13.90625,   1.4453125,   22.171875,
    807            -6.40625,   -6.99609375, 18.578125,   -10.828125,  17.8125,
    808            16.25,      16.4375,     11.5703125,  1.84765625,  5.3046875,
    809            24.140625,  8.6328125,   -9.21875,    -0.19921875, 34.1875,
    810            -16.921875, 18.671875,   2.513671875, 4.91796875
    811          ],
    812          'descriptor': {shape: [4, 6], dataType: 'float16'}
    813        }
    814      }
    815    }
    816  },
    817  {
    818    'name': 'batchNormalization float16 3D tensor default options',
    819    'graph': {
    820      'inputs': {
    821        'bnInput': {
    822          'data': [
    823            -41.3125, 64.0625,   -63.375,        -46.78125, 83,
    824            -80.0625, -62.15625, -0.10009765625, -40.90625, 56.96875,
    825            37.375,   57.03125,  82.0625,        -86.125,   76.875,
    826            97.0625,  -21.34375, -96.9375,       -9.359375, 80.1875,
    827            -85.375,  62.34375,  -68.5,          -12.109375
    828          ],
    829          'descriptor': {shape: [2, 3, 4], dataType: 'float16'}
    830        },
    831        'bnMean': {
    832          'data': [12.8125, 63.125, -61.625],
    833          'descriptor': {shape: [3], dataType: 'float16'},
    834          'constant': true
    835        },
    836        'bnVariance': {
    837          'data': [18.359375, 41.84375, 16.125],
    838          'descriptor': {shape: [3], dataType: 'float16'},
    839          'constant': true
    840        }
    841      },
    842      'operators': [{
    843        'name': 'batchNormalization',
    844        'arguments': [
    845          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'}
    846        ],
    847        'outputs': 'bnOutput'
    848      }],
    849      'expectedOutputs': {
    850        'bnOutput': {
    851          'data': [
    852            -12.6328125, 11.9609375,  -17.78125,     -13.90625,  3.072265625,
    853            -22.140625,  -19.375,     -9.7734375,    5.16015625, 29.53125,
    854            24.65625,    29.546875,   16.15625,      -23.09375,  14.953125,
    855            19.65625,    -13.0546875, -24.75,        -11.203125, 2.638671875,
    856            -5.9140625,  30.875,      -1.7119140625, 12.328125
    857          ],
    858          'descriptor': {shape: [2, 3, 4], dataType: 'float16'}
    859        }
    860      }
    861    }
    862  },
    863  {
    864    'name': 'batchNormalization float16 4D tensor default options',
    865    'graph': {
    866      'inputs': {
    867        'bnInput': {
    868          'data': [
    869            -41.3125, 64.0625,   -63.375,        -46.78125, 83,
    870            -80.0625, -62.15625, -0.10009765625, -40.90625, 56.96875,
    871            37.375,   57.03125,  82.0625,        -86.125,   76.875,
    872            97.0625,  -21.34375, -96.9375,       -9.359375, 80.1875,
    873            -85.375,  62.34375,  -68.5,          -12.109375
    874          ],
    875          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'}
    876        },
    877        'bnMean': {
    878          'data': [51.625, 99.375, -96.125],
    879          'descriptor': {shape: [3], dataType: 'float16'},
    880          'constant': true
    881        },
    882        'bnVariance': {
    883          'data': [30.453125, 86.375, 73.875],
    884          'descriptor': {shape: [3], dataType: 'float16'},
    885          'constant': true
    886        }
    887      },
    888      'operators': [{
    889        'name': 'batchNormalization',
    890        'arguments': [
    891          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'}
    892        ],
    893        'outputs': 'bnOutput'
    894      }],
    895      'expectedOutputs': {
    896        'bnOutput': {
    897          'data': [
    898            -16.84375,    2.25390625,  -20.84375,  -17.828125, -1.76171875,
    899            -19.3125,     -17.375,     -10.703125, 6.42578125, 17.8125,
    900            15.53125,     17.8125,     5.515625,   -24.96875,  4.57421875,
    901            8.234375,     -12.9921875, -21.125,    -11.703125, -2.064453125,
    902            1.2509765625, 18.4375,     3.21484375, 9.7734375
    903          ],
    904          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'}
    905        }
    906      }
    907    }
    908  },
    909  {
    910    'name': 'batchNormalization float16 5D tensor default options',
    911    'graph': {
    912      'inputs': {
    913        'bnInput': {
    914          'data': [
    915            -41.3125, 64.0625,   -63.375,        -46.78125, 83,
    916            -80.0625, -62.15625, -0.10009765625, -40.90625, 56.96875,
    917            37.375,   57.03125,  82.0625,        -86.125,   76.875,
    918            97.0625,  -21.34375, -96.9375,       -9.359375, 80.1875,
    919            -85.375,  62.34375,  -68.5,          -12.109375
    920          ],
    921          'descriptor': {shape: [6, 1, 1, 2, 2], dataType: 'float16'}
    922        },
    923        'bnMean': {
    924          'data': [35.40625],
    925          'descriptor': {shape: [1], dataType: 'float16'},
    926          'constant': true
    927        },
    928        'bnVariance': {
    929          'data': [40.9375],
    930          'descriptor': {shape: [1], dataType: 'float16'},
    931          'constant': true
    932        }
    933      },
    934      'operators': [{
    935        'name': 'batchNormalization',
    936        'arguments': [
    937          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'}
    938        ],
    939        'outputs': 'bnOutput'
    940      }],
    941      'expectedOutputs': {
    942        'bnOutput': {
    943          'data': [
    944            -11.9921875,  4.48046875, -15.4375,    -12.84375,   7.4375,
    945            -18.046875,   -15.25,     -5.55078125, -11.9296875, 3.369140625,
    946            0.3076171875, 3.37890625, 7.29296875,  -19,         6.48046875,
    947            9.6328125,    -8.8671875, -20.6875,    -6.99609375, 7,
    948            -18.875,      4.2109375,  -16.234375,  -7.42578125
    949          ],
    950          'descriptor': {shape: [6, 1, 1, 2, 2], dataType: 'float16'}
    951        }
    952      }
    953    }
    954  },
    955  {
    956    'name': 'batchNormalization float16 4D NCHW tensor options.axis=1',
    957    'graph': {
    958      'inputs': {
    959        'bnInput': {
    960          'data': [
    961            -41.3125, 64.0625,   -63.375,        -46.78125, 83,
    962            -80.0625, -62.15625, -0.10009765625, -40.90625, 56.96875,
    963            37.375,   57.03125,  82.0625,        -86.125,   76.875,
    964            97.0625,  -21.34375, -96.9375,       -9.359375, 80.1875,
    965            -85.375,  62.34375,  -68.5,          -12.109375
    966          ],
    967          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'}
    968        },
    969        'bnMean': {
    970          'data': [51.625, 99.375, -96.125],
    971          'descriptor': {shape: [3], dataType: 'float16'},
    972          'constant': true
    973        },
    974        'bnVariance': {
    975          'data': [30.453125, 86.375, 73.875],
    976          'descriptor': {shape: [3], dataType: 'float16'},
    977          'constant': true
    978        }
    979      },
    980      'operators': [{
    981        'name': 'batchNormalization',
    982        'arguments': [
    983          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
    984          {'options': {'axis': 1}}
    985        ],
    986        'outputs': 'bnOutput'
    987      }],
    988      'expectedOutputs': {
    989        'bnOutput': {
    990          'data': [
    991            -16.84375,    2.25390625,  -20.84375,  -17.828125, -1.76171875,
    992            -19.3125,     -17.375,     -10.703125, 6.42578125, 17.8125,
    993            15.53125,     17.8125,     5.515625,   -24.96875,  4.57421875,
    994            8.234375,     -12.9921875, -21.125,    -11.703125, -2.064453125,
    995            1.2509765625, 18.4375,     3.21484375, 9.7734375
    996          ],
    997          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'}
    998        }
    999      }
   1000    }
   1001  },
   1002  {
   1003    'name': 'batchNormalization float16 4D NHWC tensor options.axis=3',
   1004    'graph': {
   1005      'inputs': {
   1006        'bnInput': {
   1007          'data': [
   1008            -41.3125,       83,       -40.90625, 64.0625,   -80.0625,
   1009            56.96875,       -63.375,  -62.15625, 37.375,    -46.78125,
   1010            -0.10009765625, 57.03125, 82.0625,   -21.34375, -85.375,
   1011            -86.125,        -96.9375, 62.34375,  76.875,    -9.359375,
   1012            -68.5,          97.0625,  80.1875,   -12.109375
   1013          ],
   1014          'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'}
   1015        },
   1016        'bnMean': {
   1017          'data': [51.625, 99.375, -96.125],
   1018          'descriptor': {shape: [3], dataType: 'float16'},
   1019          'constant': true
   1020        },
   1021        'bnVariance': {
   1022          'data': [30.453125, 86.375, 73.875],
   1023          'descriptor': {shape: [3], dataType: 'float16'},
   1024          'constant': true
   1025        }
   1026      },
   1027      'operators': [{
   1028        'name': 'batchNormalization',
   1029        'arguments': [
   1030          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
   1031          {'options': {'axis': 3}}
   1032        ],
   1033        'outputs': 'bnOutput'
   1034      }],
   1035      'expectedOutputs': {
   1036        'bnOutput': {
   1037          'data': [
   1038            -16.84375,  -1.76171875, 6.42578125,   2.25390625,  -19.3125,
   1039            17.8125,    -20.84375,   -17.375,      15.53125,    -17.828125,
   1040            -10.703125, 17.8125,     5.515625,     -12.9921875, 1.2509765625,
   1041            -24.96875,  -21.125,     18.4375,      4.57421875,  -11.703125,
   1042            3.21484375, 8.234375,    -2.064453125, 9.7734375
   1043          ],
   1044          'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'}
   1045        }
   1046      }
   1047    }
   1048  },
   1049  {
   1050    'name': 'batchNormalization float16 4D NCHW tensor options.scale',
   1051    'graph': {
   1052      'inputs': {
   1053        'bnInput': {
   1054          'data': [
   1055            -41.3125, 64.0625,   -63.375,        -46.78125, 83,
   1056            -80.0625, -62.15625, -0.10009765625, -40.90625, 56.96875,
   1057            37.375,   57.03125,  82.0625,        -86.125,   76.875,
   1058            97.0625,  -21.34375, -96.9375,       -9.359375, 80.1875,
   1059            -85.375,  62.34375,  -68.5,          -12.109375
   1060          ],
   1061          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'}
   1062        },
   1063        'bnMean': {
   1064          'data': [51.625, 99.375, -96.125],
   1065          'descriptor': {shape: [3], dataType: 'float16'},
   1066          'constant': true
   1067        },
   1068        'bnVariance': {
   1069          'data': [30.453125, 86.375, 73.875],
   1070          'descriptor': {shape: [3], dataType: 'float16'},
   1071          'constant': true
   1072        },
   1073        'bnScale': {
   1074          'data': [65.5, -71, -5.5703125],
   1075          'descriptor': {shape: [3], dataType: 'float16'},
   1076          'constant': true
   1077        }
   1078      },
   1079      'operators': [{
   1080        'name': 'batchNormalization',
   1081        'arguments': [
   1082          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
   1083          {'options': {'scale': 'bnScale'}}
   1084        ],
   1085        'outputs': 'bnOutput'
   1086      }],
   1087      'expectedOutputs': {
   1088        'bnOutput': {
   1089          'data': [
   1090            -1103,  147.625, -1365,     -1168,     125.125,   1371,
   1091            1234,   760,     -35.78125, -99.1875,  -86.5,     -99.25,
   1092            361.25, -1635,   299.75,    539.5,     922,       1500,
   1093            830.5,  146.625, -6.96875,  -102.6875, -17.90625, -54.4375
   1094          ],
   1095          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'}
   1096        }
   1097      }
   1098    }
   1099  },
   1100  {
   1101    'name': 'batchNormalization float16 4D NCHW tensor options.bias',
   1102    'graph': {
   1103      'inputs': {
   1104        'bnInput': {
   1105          'data': [
   1106            -41.3125, 64.0625,   -63.375,        -46.78125, 83,
   1107            -80.0625, -62.15625, -0.10009765625, -40.90625, 56.96875,
   1108            37.375,   57.03125,  82.0625,        -86.125,   76.875,
   1109            97.0625,  -21.34375, -96.9375,       -9.359375, 80.1875,
   1110            -85.375,  62.34375,  -68.5,          -12.109375
   1111          ],
   1112          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'}
   1113        },
   1114        'bnMean': {
   1115          'data': [51.625, 99.375, -96.125],
   1116          'descriptor': {shape: [3], dataType: 'float16'},
   1117          'constant': true
   1118        },
   1119        'bnVariance': {
   1120          'data': [30.453125, 86.375, 73.875],
   1121          'descriptor': {shape: [3], dataType: 'float16'},
   1122          'constant': true
   1123        },
   1124        'bnBias': {
   1125          'data': [64.1875, 75.3125, -84.5625],
   1126          'descriptor': {shape: [3], dataType: 'float16'},
   1127          'constant': true
   1128        }
   1129      },
   1130      'operators': [{
   1131        'name': 'batchNormalization',
   1132        'arguments': [
   1133          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
   1134          {'options': {'bias': 'bnBias'}}
   1135        ],
   1136        'outputs': 'bnOutput'
   1137      }],
   1138      'expectedOutputs': {
   1139        'bnOutput': {
   1140          'data': [
   1141            47.34375, 66.4375,  43.34375, 46.34375, 73.5625, 56,
   1142            57.9375,  64.625,   -78.125,  -66.75,   -69,     -66.75,
   1143            69.6875,  39.21875, 68.75,    72.4375,  62.3125, 54.1875,
   1144            63.625,   73.25,    -83.3125, -66.125,  -81.375, -74.8125
   1145          ],
   1146          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'}
   1147        }
   1148      }
   1149    }
   1150  },
   1151  {
   1152    'name': 'batchNormalization float16 4D NCHW tensor options.epsilon',
   1153    'graph': {
   1154      'inputs': {
   1155        'bnInput': {
   1156          'data': [
   1157            -41.3125, 64.0625,   -63.375,        -46.78125, 83,
   1158            -80.0625, -62.15625, -0.10009765625, -40.90625, 56.96875,
   1159            37.375,   57.03125,  82.0625,        -86.125,   76.875,
   1160            97.0625,  -21.34375, -96.9375,       -9.359375, 80.1875,
   1161            -85.375,  62.34375,  -68.5,          -12.109375
   1162          ],
   1163          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'}
   1164        },
   1165        'bnMean': {
   1166          'data': [51.625, 99.375, -96.125],
   1167          'descriptor': {shape: [3], dataType: 'float16'},
   1168          'constant': true
   1169        },
   1170        'bnVariance': {
   1171          'data': [30.453125, 86.375, 73.875],
   1172          'descriptor': {shape: [3], dataType: 'float16'},
   1173          'constant': true
   1174        }
   1175      },
   1176      'operators': [{
   1177        'name': 'batchNormalization',
   1178        'arguments': [
   1179          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
   1180          {'options': {'epsilon': 0.000001}}
   1181        ],
   1182        'outputs': 'bnOutput'
   1183      }],
   1184      'expectedOutputs': {
   1185        'bnOutput': {
   1186          'data': [
   1187            -16.84375,    2.25390625,  -20.84375,  -17.828125, -1.76171875,
   1188            -19.3125,     -17.375,     -10.703125, 6.42578125, 17.8125,
   1189            15.53125,     17.8125,     5.515625,   -24.96875,  4.57421875,
   1190            8.234375,     -12.9921875, -21.125,    -11.703125, -2.064453125,
   1191            1.2509765625, 18.4375,     3.21484375, 9.7734375
   1192          ],
   1193          'descriptor': {shape: [2, 3, 2, 2], dataType: 'float16'}
   1194        }
   1195      }
   1196    }
   1197  },
   1198  {
   1199    'name': 'batchNormalization float16 4D NHWC tensor all options',
   1200    'graph': {
   1201      'inputs': {
   1202        'bnInput': {
   1203          'data': [
   1204            -41.3125,       83,       -40.90625, 64.0625,   -80.0625,
   1205            56.96875,       -63.375,  -62.15625, 37.375,    -46.78125,
   1206            -0.10009765625, 57.03125, 82.0625,   -21.34375, -85.375,
   1207            -86.125,        -96.9375, 62.34375,  76.875,    -9.359375,
   1208            -68.5,          97.0625,  80.1875,   -12.109375
   1209          ],
   1210          'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'}
   1211        },
   1212        'bnMean': {
   1213          'data': [51.625, 99.375, -96.125],
   1214          'descriptor': {shape: [3], dataType: 'float16'},
   1215          'constant': true
   1216        },
   1217        'bnVariance': {
   1218          'data': [30.453125, 86.375, 73.875],
   1219          'descriptor': {shape: [3], dataType: 'float16'},
   1220          'constant': true
   1221        },
   1222        'bnScale': {
   1223          'data': [65.5, -71, -5.5703125],
   1224          'descriptor': {shape: [3], dataType: 'float16'},
   1225          'constant': true
   1226        },
   1227        'bnBias': {
   1228          'data': [64.1875, 75.3125, -84.5625],
   1229          'descriptor': {shape: [3], dataType: 'float16'},
   1230          'constant': true
   1231        }
   1232      },
   1233      'operators': [{
   1234        'name': 'batchNormalization',
   1235        'arguments': [
   1236          {'input': 'bnInput'}, {'mean': 'bnMean'}, {'variance': 'bnVariance'},
   1237          {
   1238            'options': {
   1239              'scale': 'bnScale',
   1240              'bias': 'bnBias',
   1241              'axis': 3,
   1242              'epsilon': 0.000001
   1243            }
   1244          }
   1245        ],
   1246        'outputs': 'bnOutput'
   1247      }],
   1248      'expectedOutputs': {
   1249        'bnOutput': {
   1250          'data': [
   1251            -1039, 200.375, -120.375,  211.75, 1446,    -183.75,
   1252            -1301, 1309,    -171.125,  -1104,  835.5,   -183.875,
   1253            425.5, 997.5,   -91.5,     -1571,  1575,    -187.25,
   1254            364,   906,     -102.4375, 603.5,  221.875, -139
   1255          ],
   1256          'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'}
   1257        }
   1258      }
   1259    }
   1260  }
   1261 ];
   1262 
   1263 webnn_conformance_test(
   1264    batchNormTests, buildAndExecuteGraph, getPrecisionTolerance);