tor-browser

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

softsign.https.any.js (24895B)


      1 // META: title=test WebNN API softsign 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-softsign-method
     12 // Compute the softsign function of the input tensor. The calculation follows
     13 // the expression x / (1 + |x|).
     14 //
     15 // MLOperand softsign(MLOperand input);
     16 
     17 const softsignTests = [
     18  {
     19    'name': 'softsign positive float32 1D constant tensor',
     20    'graph': {
     21      'inputs': {
     22        'softsignInput': {
     23          'data': [
     24            1.5834133625030518, 4.078719139099121, 8.883357048034668,
     25            8.070859909057617,  8.211773872375488, 2.4554004669189453,
     26            0.653374195098877,  7.866281032562256, 3.123955249786377,
     27            8.013792037963867,  3.940986156463623, 1.813172698020935,
     28            2.3906760215759277, 1.335968017578125, 9.416410446166992,
     29            0.4432569146156311, 5.236661911010742, 9.42424201965332,
     30            7.816190242767334,  5.849185943603516, 8.780370712280273,
     31            5.120515823364258,  7.117222309112549, 4.599106788635254
     32          ],
     33          'descriptor': {shape: [24], dataType: 'float32'},
     34          'constant': true
     35        }
     36      },
     37      'operators': [{
     38        'name': 'softsign',
     39        'arguments': [{'input': 'softsignInput'}],
     40        'outputs': 'softsignOutput'
     41      }],
     42      'expectedOutputs': {
     43        'softsignOutput': {
     44          'data': [
     45            0.6129152178764343,  0.8030999898910522, 0.8988198041915894,
     46            0.8897568583488464,  0.8914432525634766, 0.7105979323387146,
     47            0.3951762318611145,  0.8872131109237671, 0.7575143575668335,
     48            0.8890588879585266,  0.7976112365722656, 0.6445294618606567,
     49            0.7050735354423523,  0.5719119310379028, 0.9039976596832275,
     50            0.30712267756462097, 0.8396578431129456, 0.9040697813034058,
     51            0.8865723013877869,  0.8539972305297852, 0.8977543711662292,
     52            0.8366150856018066,  0.8768051266670227, 0.8214001059532166
     53          ],
     54          'descriptor': {shape: [24], dataType: 'float32'}
     55        }
     56      }
     57    }
     58  },
     59  {
     60    'name': 'softsign positive float32 0D tensor',
     61    'graph': {
     62      'inputs': {
     63        'softsignInput': {
     64          'data': [1.5834133625030518],
     65          'descriptor': {shape: [], dataType: 'float32'}
     66        }
     67      },
     68      'operators': [{
     69        'name': 'softsign',
     70        'arguments': [{'input': 'softsignInput'}],
     71        'outputs': 'softsignOutput'
     72      }],
     73      'expectedOutputs': {
     74        'softsignOutput': {
     75          'data': [0.6129152178764343],
     76          'descriptor': {shape: [], dataType: 'float32'}
     77        }
     78      }
     79    }
     80  },
     81  {
     82    'name': 'softsign negative float32 0D tensor',
     83    'graph': {
     84      'inputs': {
     85        'softsignInput': {
     86          'data': [-2.597844123840332],
     87          'descriptor': {shape: [], dataType: 'float32'}
     88        }
     89      },
     90      'operators': [{
     91        'name': 'softsign',
     92        'arguments': [{'input': 'softsignInput'}],
     93        'outputs': 'softsignOutput'
     94      }],
     95      'expectedOutputs': {
     96        'softsignOutput': {
     97          'data': [-0.7220557928085327],
     98          'descriptor': {shape: [], dataType: 'float32'}
     99        }
    100      }
    101    }
    102  },
    103  {
    104    'name': 'softsign positive float32 1D tensor',
    105    'graph': {
    106      'inputs': {
    107        'softsignInput': {
    108          'data': [
    109            1.5834133625030518, 4.078719139099121, 8.883357048034668,
    110            8.070859909057617,  8.211773872375488, 2.4554004669189453,
    111            0.653374195098877,  7.866281032562256, 3.123955249786377,
    112            8.013792037963867,  3.940986156463623, 1.813172698020935,
    113            2.3906760215759277, 1.335968017578125, 9.416410446166992,
    114            0.4432569146156311, 5.236661911010742, 9.42424201965332,
    115            7.816190242767334,  5.849185943603516, 8.780370712280273,
    116            5.120515823364258,  7.117222309112549, 4.599106788635254
    117          ],
    118          'descriptor': {shape: [24], dataType: 'float32'}
    119        }
    120      },
    121      'operators': [{
    122        'name': 'softsign',
    123        'arguments': [{'input': 'softsignInput'}],
    124        'outputs': 'softsignOutput'
    125      }],
    126      'expectedOutputs': {
    127        'softsignOutput': {
    128          'data': [
    129            0.6129152178764343,  0.8030999898910522, 0.8988198041915894,
    130            0.8897568583488464,  0.8914432525634766, 0.7105979323387146,
    131            0.3951762318611145,  0.8872131109237671, 0.7575143575668335,
    132            0.8890588879585266,  0.7976112365722656, 0.6445294618606567,
    133            0.7050735354423523,  0.5719119310379028, 0.9039976596832275,
    134            0.30712267756462097, 0.8396578431129456, 0.9040697813034058,
    135            0.8865723013877869,  0.8539972305297852, 0.8977543711662292,
    136            0.8366150856018066,  0.8768051266670227, 0.8214001059532166
    137          ],
    138          'descriptor': {shape: [24], dataType: 'float32'}
    139        }
    140      }
    141    }
    142  },
    143  {
    144    'name': 'softsign negative float32 1D tensor',
    145    'graph': {
    146      'inputs': {
    147        'softsignInput': {
    148          'data': [
    149            -2.597844123840332,  -0.4449555575847626, -9.095475196838379,
    150            -3.7480077743530273, -1.3867290019989014, -8.220329284667969,
    151            -3.538342237472534,  -9.364588737487793,  -6.283252239227295,
    152            -5.002012252807617,  -8.245729446411133,  -3.775470495223999,
    153            -4.087255001068115,  -7.381676197052002,  -5.8829216957092285,
    154            -8.338910102844238,  -6.60154914855957,   -4.491941928863525,
    155            -3.5247786045074463, -4.43991231918335,   -5.234262466430664,
    156            -1.5911732912063599, -9.106277465820312,  -8.523774147033691
    157          ],
    158          'descriptor': {shape: [24], dataType: 'float32'}
    159        }
    160      },
    161      'operators': [{
    162        'name': 'softsign',
    163        'arguments': [{'input': 'softsignInput'}],
    164        'outputs': 'softsignOutput'
    165      }],
    166      'expectedOutputs': {
    167        'softsignOutput': {
    168          'data': [
    169            -0.7220557928085327, -0.3079372048377991, -0.9009457230567932,
    170            -0.7893853783607483, -0.5810165405273438, -0.891543984413147,
    171            -0.7796552181243896, -0.9035176634788513, -0.8626986742019653,
    172            -0.8333892226219177, -0.8918419480323792, -0.7905965447425842,
    173            -0.8034303188323975, -0.8806921243667603, -0.8547128438949585,
    174            -0.8929211497306824, -0.8684478402137756, -0.8179150223731995,
    175            -0.7789947390556335, -0.8161734938621521, -0.8395960927009583,
    176            -0.6140744686126709, -0.9010515809059143, -0.894999623298645
    177          ],
    178          'descriptor': {shape: [24], dataType: 'float32'}
    179        }
    180      }
    181    }
    182  },
    183  {
    184    'name': 'softsign float32 2D tensor',
    185    'graph': {
    186      'inputs': {
    187        'softsignInput': {
    188          'data': [
    189            -8.343496322631836,  -6.920152187347412,  2.699638843536377,
    190            -8.663105010986328,  -3.1905343532562256, 7.657886981964111,
    191            6.650215148925781,   6.058011054992676,   0.6634320616722107,
    192            5.8058037757873535,  -0.32821124792099,   1.2704304456710815,
    193            -9.946120262145996,  6.905375003814697,   -0.031071536242961884,
    194            -3.9696409702301025, 6.270823001861572,   -2.639260768890381,
    195            3.0513505935668945,  7.426476955413818,   -8.454667091369629,
    196            7.135868072509766,   -4.986093997955322,  -7.859614849090576
    197          ],
    198          'descriptor': {shape: [4, 6], dataType: 'float32'}
    199        }
    200      },
    201      'operators': [{
    202        'name': 'softsign',
    203        'arguments': [{'input': 'softsignInput'}],
    204        'outputs': 'softsignOutput'
    205      }],
    206      'expectedOutputs': {
    207        'softsignOutput': {
    208          'data': [
    209            -0.8929736614227295, -0.8737397789955139,  0.7297033667564392,
    210            -0.8965135812759399, -0.7613669633865356,  0.8844983577728271,
    211            0.8692847490310669,  0.8583170175552368,   0.3988332748413086,
    212            0.8530665636062622,  -0.24710771441459656, 0.5595548748970032,
    213            -0.9086434245109558, 0.8735038042068481,   -0.03013519011437893,
    214            -0.798778235912323,  0.8624640107154846,   -0.7252188920974731,
    215            0.7531687617301941,  0.88132643699646,     -0.8942321538925171,
    216            0.8770874738693237,  -0.8329461812973022,  -0.8871282935142517
    217          ],
    218          'descriptor': {shape: [4, 6], dataType: 'float32'}
    219        }
    220      }
    221    }
    222  },
    223  {
    224    'name': 'softsign float32 3D tensor',
    225    'graph': {
    226      'inputs': {
    227        'softsignInput': {
    228          'data': [
    229            -8.343496322631836,  -6.920152187347412,  2.699638843536377,
    230            -8.663105010986328,  -3.1905343532562256, 7.657886981964111,
    231            6.650215148925781,   6.058011054992676,   0.6634320616722107,
    232            5.8058037757873535,  -0.32821124792099,   1.2704304456710815,
    233            -9.946120262145996,  6.905375003814697,   -0.031071536242961884,
    234            -3.9696409702301025, 6.270823001861572,   -2.639260768890381,
    235            3.0513505935668945,  7.426476955413818,   -8.454667091369629,
    236            7.135868072509766,   -4.986093997955322,  -7.859614849090576
    237          ],
    238          'descriptor': {shape: [2, 3, 4], dataType: 'float32'}
    239        }
    240      },
    241      'operators': [{
    242        'name': 'softsign',
    243        'arguments': [{'input': 'softsignInput'}],
    244        'outputs': 'softsignOutput'
    245      }],
    246      'expectedOutputs': {
    247        'softsignOutput': {
    248          'data': [
    249            -0.8929736614227295, -0.8737397789955139,  0.7297033667564392,
    250            -0.8965135812759399, -0.7613669633865356,  0.8844983577728271,
    251            0.8692847490310669,  0.8583170175552368,   0.3988332748413086,
    252            0.8530665636062622,  -0.24710771441459656, 0.5595548748970032,
    253            -0.9086434245109558, 0.8735038042068481,   -0.03013519011437893,
    254            -0.798778235912323,  0.8624640107154846,   -0.7252188920974731,
    255            0.7531687617301941,  0.88132643699646,     -0.8942321538925171,
    256            0.8770874738693237,  -0.8329461812973022,  -0.8871282935142517
    257          ],
    258          'descriptor': {shape: [2, 3, 4], dataType: 'float32'}
    259        }
    260      }
    261    }
    262  },
    263  {
    264    'name': 'softsign float32 4D tensor',
    265    'graph': {
    266      'inputs': {
    267        'softsignInput': {
    268          'data': [
    269            -8.343496322631836,  -6.920152187347412,  2.699638843536377,
    270            -8.663105010986328,  -3.1905343532562256, 7.657886981964111,
    271            6.650215148925781,   6.058011054992676,   0.6634320616722107,
    272            5.8058037757873535,  -0.32821124792099,   1.2704304456710815,
    273            -9.946120262145996,  6.905375003814697,   -0.031071536242961884,
    274            -3.9696409702301025, 6.270823001861572,   -2.639260768890381,
    275            3.0513505935668945,  7.426476955413818,   -8.454667091369629,
    276            7.135868072509766,   -4.986093997955322,  -7.859614849090576
    277          ],
    278          'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'}
    279        }
    280      },
    281      'operators': [{
    282        'name': 'softsign',
    283        'arguments': [{'input': 'softsignInput'}],
    284        'outputs': 'softsignOutput'
    285      }],
    286      'expectedOutputs': {
    287        'softsignOutput': {
    288          'data': [
    289            -0.8929736614227295, -0.8737397789955139,  0.7297033667564392,
    290            -0.8965135812759399, -0.7613669633865356,  0.8844983577728271,
    291            0.8692847490310669,  0.8583170175552368,   0.3988332748413086,
    292            0.8530665636062622,  -0.24710771441459656, 0.5595548748970032,
    293            -0.9086434245109558, 0.8735038042068481,   -0.03013519011437893,
    294            -0.798778235912323,  0.8624640107154846,   -0.7252188920974731,
    295            0.7531687617301941,  0.88132643699646,     -0.8942321538925171,
    296            0.8770874738693237,  -0.8329461812973022,  -0.8871282935142517
    297          ],
    298          'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'}
    299        }
    300      }
    301    }
    302  },
    303  {
    304    'name': 'softsign float32 5D tensor',
    305    'graph': {
    306      'inputs': {
    307        'softsignInput': {
    308          'data': [
    309            -8.343496322631836,  -6.920152187347412,  2.699638843536377,
    310            -8.663105010986328,  -3.1905343532562256, 7.657886981964111,
    311            6.650215148925781,   6.058011054992676,   0.6634320616722107,
    312            5.8058037757873535,  -0.32821124792099,   1.2704304456710815,
    313            -9.946120262145996,  6.905375003814697,   -0.031071536242961884,
    314            -3.9696409702301025, 6.270823001861572,   -2.639260768890381,
    315            3.0513505935668945,  7.426476955413818,   -8.454667091369629,
    316            7.135868072509766,   -4.986093997955322,  -7.859614849090576
    317          ],
    318          'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'}
    319        }
    320      },
    321      'operators': [{
    322        'name': 'softsign',
    323        'arguments': [{'input': 'softsignInput'}],
    324        'outputs': 'softsignOutput'
    325      }],
    326      'expectedOutputs': {
    327        'softsignOutput': {
    328          'data': [
    329            -0.8929736614227295, -0.8737397789955139,  0.7297033667564392,
    330            -0.8965135812759399, -0.7613669633865356,  0.8844983577728271,
    331            0.8692847490310669,  0.8583170175552368,   0.3988332748413086,
    332            0.8530665636062622,  -0.24710771441459656, 0.5595548748970032,
    333            -0.9086434245109558, 0.8735038042068481,   -0.03013519011437893,
    334            -0.798778235912323,  0.8624640107154846,   -0.7252188920974731,
    335            0.7531687617301941,  0.88132643699646,     -0.8942321538925171,
    336            0.8770874738693237,  -0.8329461812973022,  -0.8871282935142517
    337          ],
    338          'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'}
    339        }
    340      }
    341    }
    342  },
    343 
    344  // float16 tests
    345  {
    346    'name': 'softsign positive float16 1D constant tensor',
    347    'graph': {
    348      'inputs': {
    349        'softsignInput': {
    350          'data': [
    351            1.5830078125, 4.078125,     8.8828125, 8.0703125,   8.2109375,
    352            2.455078125,  0.6533203125, 7.8671875, 3.123046875, 8.015625,
    353            3.94140625,   1.8134765625, 2.390625,  1.3359375,   9.4140625,
    354            0.443359375,  5.23828125,   9.421875,  7.81640625,  5.84765625,
    355            8.78125,      5.12109375,   7.1171875, 4.59765625
    356          ],
    357          'descriptor': {shape: [24], dataType: 'float16'},
    358          'constant': true
    359        }
    360      },
    361      'operators': [{
    362        'name': 'softsign',
    363        'arguments': [{'input': 'softsignInput'}],
    364        'outputs': 'softsignOutput'
    365      }],
    366      'expectedOutputs': {
    367        'softsignOutput': {
    368          'data': [
    369            0.61279296875, 0.80322265625, 0.89892578125,  0.8896484375,
    370            0.8916015625,  0.71044921875, 0.395263671875, 0.88720703125,
    371            0.75732421875, 0.88916015625, 0.7978515625,   0.64453125,
    372            0.705078125,   0.57177734375, 0.90380859375,  0.30712890625,
    373            0.83984375,    0.90380859375, 0.88671875,     0.85400390625,
    374            0.89794921875, 0.83642578125, 0.876953125,    0.8212890625
    375          ],
    376          'descriptor': {shape: [24], dataType: 'float16'}
    377        }
    378      }
    379    }
    380  },
    381  {
    382    'name': 'softsign positive float16 0D tensor',
    383    'graph': {
    384      'inputs': {
    385        'softsignInput': {
    386          'data': [1.5830078125],
    387          'descriptor': {shape: [], dataType: 'float16'}
    388        }
    389      },
    390      'operators': [{
    391        'name': 'softsign',
    392        'arguments': [{'input': 'softsignInput'}],
    393        'outputs': 'softsignOutput'
    394      }],
    395      'expectedOutputs': {
    396        'softsignOutput': {
    397          'data': [0.61279296875],
    398          'descriptor': {shape: [], dataType: 'float16'}
    399        }
    400      }
    401    }
    402  },
    403  {
    404    'name': 'softsign negative float16 0D tensor',
    405    'graph': {
    406      'inputs': {
    407        'softsignInput': {
    408          'data': [-2.59765625],
    409          'descriptor': {shape: [], dataType: 'float16'}
    410        }
    411      },
    412      'operators': [{
    413        'name': 'softsign',
    414        'arguments': [{'input': 'softsignInput'}],
    415        'outputs': 'softsignOutput'
    416      }],
    417      'expectedOutputs': {
    418        'softsignOutput': {
    419          'data': [-0.72216796875],
    420          'descriptor': {shape: [], dataType: 'float16'}
    421        }
    422      }
    423    }
    424  },
    425  {
    426    'name': 'softsign positive float16 1D tensor',
    427    'graph': {
    428      'inputs': {
    429        'softsignInput': {
    430          'data': [
    431            1.5830078125, 4.078125,     8.8828125, 8.0703125,   8.2109375,
    432            2.455078125,  0.6533203125, 7.8671875, 3.123046875, 8.015625,
    433            3.94140625,   1.8134765625, 2.390625,  1.3359375,   9.4140625,
    434            0.443359375,  5.23828125,   9.421875,  7.81640625,  5.84765625,
    435            8.78125,      5.12109375,   7.1171875, 4.59765625
    436          ],
    437          'descriptor': {shape: [24], dataType: 'float16'}
    438        }
    439      },
    440      'operators': [{
    441        'name': 'softsign',
    442        'arguments': [{'input': 'softsignInput'}],
    443        'outputs': 'softsignOutput'
    444      }],
    445      'expectedOutputs': {
    446        'softsignOutput': {
    447          'data': [
    448            0.61279296875, 0.80322265625, 0.89892578125,  0.8896484375,
    449            0.8916015625,  0.71044921875, 0.395263671875, 0.88720703125,
    450            0.75732421875, 0.88916015625, 0.7978515625,   0.64453125,
    451            0.705078125,   0.57177734375, 0.90380859375,  0.30712890625,
    452            0.83984375,    0.90380859375, 0.88671875,     0.85400390625,
    453            0.89794921875, 0.83642578125, 0.876953125,    0.8212890625
    454          ],
    455          'descriptor': {shape: [24], dataType: 'float16'}
    456        }
    457      }
    458    }
    459  },
    460  {
    461    'name': 'softsign negative float16 1D tensor',
    462    'graph': {
    463      'inputs': {
    464        'softsignInput': {
    465          'data': [
    466            -2.59765625, -0.445068359375, -9.09375,   -3.748046875, -1.38671875,
    467            -8.21875,    -3.5390625,      -9.3671875, -6.28515625,  -5.00390625,
    468            -8.2421875,  -3.775390625,    -4.0859375, -7.3828125,   -5.8828125,
    469            -8.3359375,  -6.6015625,      -4.4921875, -3.525390625, -4.44140625,
    470            -5.234375,   -1.5908203125,   -9.109375,  -8.5234375
    471          ],
    472          'descriptor': {shape: [24], dataType: 'float16'}
    473        }
    474      },
    475      'operators': [{
    476        'name': 'softsign',
    477        'arguments': [{'input': 'softsignInput'}],
    478        'outputs': 'softsignOutput'
    479      }],
    480      'expectedOutputs': {
    481        'softsignOutput': {
    482          'data': [
    483            -0.72216796875, -0.30810546875, -0.90087890625, -0.78955078125,
    484            -0.5810546875,  -0.8916015625,  -0.77978515625, -0.9033203125,
    485            -0.86279296875, -0.83349609375, -0.8916015625,  -0.79052734375,
    486            -0.80322265625, -0.880859375,   -0.8544921875,  -0.89306640625,
    487            -0.86865234375, -0.81787109375, -0.77880859375, -0.81640625,
    488            -0.83935546875, -0.6142578125,  -0.90087890625, -0.89501953125
    489          ],
    490          'descriptor': {shape: [24], dataType: 'float16'}
    491        }
    492      }
    493    }
    494  },
    495  {
    496    'name': 'softsign float16 2D tensor',
    497    'graph': {
    498      'inputs': {
    499        'softsignInput': {
    500          'data': [
    501            -8.34375,      -6.921875,    2.69921875,        -8.6640625,
    502            -3.19140625,   7.65625,      6.6484375,         6.05859375,
    503            0.66357421875, 5.8046875,    -0.328125,         1.2705078125,
    504            -9.9453125,    6.90625,      -0.03106689453125, -3.96875,
    505            6.26953125,    -2.638671875, 3.05078125,        7.42578125,
    506            -8.453125,     7.13671875,   -4.984375,         -7.859375
    507          ],
    508          'descriptor': {shape: [4, 6], dataType: 'float16'}
    509        }
    510      },
    511      'operators': [{
    512        'name': 'softsign',
    513        'arguments': [{'input': 'softsignInput'}],
    514        'outputs': 'softsignOutput'
    515      }],
    516      'expectedOutputs': {
    517        'softsignOutput': {
    518          'data': [
    519            -0.89306640625, -0.87353515625, 0.7294921875,
    520            -0.896484375,   -0.76123046875, 0.88427734375,
    521            0.869140625,    0.8583984375,   0.39892578125,
    522            0.85302734375,  -0.2470703125,  0.5595703125,
    523            -0.90869140625, 0.87353515625,  -0.0301361083984375,
    524            -0.798828125,   0.8623046875,   -0.72509765625,
    525            0.7529296875,   0.88134765625,  -0.89404296875,
    526            0.876953125,    -0.8330078125,  -0.88720703125
    527          ],
    528          'descriptor': {shape: [4, 6], dataType: 'float16'}
    529        }
    530      }
    531    }
    532  },
    533  {
    534    'name': 'softsign float16 3D tensor',
    535    'graph': {
    536      'inputs': {
    537        'softsignInput': {
    538          'data': [
    539            -8.34375,      -6.921875,    2.69921875,        -8.6640625,
    540            -3.19140625,   7.65625,      6.6484375,         6.05859375,
    541            0.66357421875, 5.8046875,    -0.328125,         1.2705078125,
    542            -9.9453125,    6.90625,      -0.03106689453125, -3.96875,
    543            6.26953125,    -2.638671875, 3.05078125,        7.42578125,
    544            -8.453125,     7.13671875,   -4.984375,         -7.859375
    545          ],
    546          'descriptor': {shape: [2, 3, 4], dataType: 'float16'}
    547        }
    548      },
    549      'operators': [{
    550        'name': 'softsign',
    551        'arguments': [{'input': 'softsignInput'}],
    552        'outputs': 'softsignOutput'
    553      }],
    554      'expectedOutputs': {
    555        'softsignOutput': {
    556          'data': [
    557            -0.89306640625, -0.87353515625, 0.7294921875,
    558            -0.896484375,   -0.76123046875, 0.88427734375,
    559            0.869140625,    0.8583984375,   0.39892578125,
    560            0.85302734375,  -0.2470703125,  0.5595703125,
    561            -0.90869140625, 0.87353515625,  -0.0301361083984375,
    562            -0.798828125,   0.8623046875,   -0.72509765625,
    563            0.7529296875,   0.88134765625,  -0.89404296875,
    564            0.876953125,    -0.8330078125,  -0.88720703125
    565          ],
    566          'descriptor': {shape: [2, 3, 4], dataType: 'float16'}
    567        }
    568      }
    569    }
    570  },
    571  {
    572    'name': 'softsign float16 4D tensor',
    573    'graph': {
    574      'inputs': {
    575        'softsignInput': {
    576          'data': [
    577            -8.34375,      -6.921875,    2.69921875,        -8.6640625,
    578            -3.19140625,   7.65625,      6.6484375,         6.05859375,
    579            0.66357421875, 5.8046875,    -0.328125,         1.2705078125,
    580            -9.9453125,    6.90625,      -0.03106689453125, -3.96875,
    581            6.26953125,    -2.638671875, 3.05078125,        7.42578125,
    582            -8.453125,     7.13671875,   -4.984375,         -7.859375
    583          ],
    584          'descriptor': {shape: [1, 2, 3, 4], dataType: 'float16'}
    585        }
    586      },
    587      'operators': [{
    588        'name': 'softsign',
    589        'arguments': [{'input': 'softsignInput'}],
    590        'outputs': 'softsignOutput'
    591      }],
    592      'expectedOutputs': {
    593        'softsignOutput': {
    594          'data': [
    595            -0.89306640625, -0.87353515625, 0.7294921875,
    596            -0.896484375,   -0.76123046875, 0.88427734375,
    597            0.869140625,    0.8583984375,   0.39892578125,
    598            0.85302734375,  -0.2470703125,  0.5595703125,
    599            -0.90869140625, 0.87353515625,  -0.0301361083984375,
    600            -0.798828125,   0.8623046875,   -0.72509765625,
    601            0.7529296875,   0.88134765625,  -0.89404296875,
    602            0.876953125,    -0.8330078125,  -0.88720703125
    603          ],
    604          'descriptor': {shape: [1, 2, 3, 4], dataType: 'float16'}
    605        }
    606      }
    607    }
    608  },
    609  {
    610    'name': 'softsign float16 5D tensor',
    611    'graph': {
    612      'inputs': {
    613        'softsignInput': {
    614          'data': [
    615            -8.34375,      -6.921875,    2.69921875,        -8.6640625,
    616            -3.19140625,   7.65625,      6.6484375,         6.05859375,
    617            0.66357421875, 5.8046875,    -0.328125,         1.2705078125,
    618            -9.9453125,    6.90625,      -0.03106689453125, -3.96875,
    619            6.26953125,    -2.638671875, 3.05078125,        7.42578125,
    620            -8.453125,     7.13671875,   -4.984375,         -7.859375
    621          ],
    622          'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float16'}
    623        }
    624      },
    625      'operators': [{
    626        'name': 'softsign',
    627        'arguments': [{'input': 'softsignInput'}],
    628        'outputs': 'softsignOutput'
    629      }],
    630      'expectedOutputs': {
    631        'softsignOutput': {
    632          'data': [
    633            -0.89306640625, -0.87353515625, 0.7294921875,
    634            -0.896484375,   -0.76123046875, 0.88427734375,
    635            0.869140625,    0.8583984375,   0.39892578125,
    636            0.85302734375,  -0.2470703125,  0.5595703125,
    637            -0.90869140625, 0.87353515625,  -0.0301361083984375,
    638            -0.798828125,   0.8623046875,   -0.72509765625,
    639            0.7529296875,   0.88134765625,  -0.89404296875,
    640            0.876953125,    -0.8330078125,  -0.88720703125
    641          ],
    642          'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float16'}
    643        }
    644      }
    645    }
    646  }
    647 ];
    648 
    649 webnn_conformance_test(
    650    softsignTests, buildAndExecuteGraph, getPrecisionTolerance);