summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webnn/resources/test_data/layer_normalization.json
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/webnn/resources/test_data/layer_normalization.json')
-rw-r--r--testing/web-platform/tests/webnn/resources/test_data/layer_normalization.json842
1 files changed, 842 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webnn/resources/test_data/layer_normalization.json b/testing/web-platform/tests/webnn/resources/test_data/layer_normalization.json
new file mode 100644
index 0000000000..6005776de5
--- /dev/null
+++ b/testing/web-platform/tests/webnn/resources/test_data/layer_normalization.json
@@ -0,0 +1,842 @@
+{
+ "tests": [
+ {
+ "name": "layerNormalization float32 2D tensor default options",
+ "inputs": {
+ "input": {
+ "shape": [4, 6],
+ "data": [
+ -35.51446620394829,
+ 54.735407789317094,
+ 19.65901979009459,
+ -15.882677905820188,
+ 65.48657727565143,
+ 25.818493353057278,
+ 97.5530279802174,
+ -8.057161374785466,
+ 62.941297318740425,
+ -48.91555566709158,
+ 91.90643767958213,
+ 46.67098666459884,
+ -74.85331462850246,
+ 30.12636276060539,
+ 26.130894553011203,
+ 59.302706651602165,
+ -60.36199702412532,
+ 18.556152152037427,
+ -88.0373081005649,
+ -26.566773146168643,
+ 70.81292942844541,
+ 9.1056120562301,
+ 56.66746139054709,
+ 21.78444497295007
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "shape": [4, 6],
+ "data": [
+ -1.5257738828659058,
+ 0.997844934463501,
+ 0.017018765211105347,
+ -0.9768186211585999,
+ 1.2984753847122192,
+ 0.18925349414348602,
+ 1.0812907218933105,
+ -0.915019690990448,
+ 0.4270379841327667,
+ -1.6873507499694824,
+ 0.9745554327964783,
+ 0.11948632448911667,
+ -1.5086692571640015,
+ 0.6123882532119751,
+ 0.5316619873046875,
+ 1.2018805742263794,
+ -1.215880036354065,
+ 0.378618448972702,
+ -1.795186161994934,
+ -0.6376377940177917,
+ 1.1961140632629395,
+ 0.034106940031051636,
+ 0.9297415614128113,
+ 0.2728613615036011
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "layerNormalization float32 3D tensor default options",
+ "inputs": {
+ "input": {
+ "shape": [2, 3, 4],
+ "data": [
+ -35.51446620394829,
+ 54.735407789317094,
+ 19.65901979009459,
+ -15.882677905820188,
+ 65.48657727565143,
+ 25.818493353057278,
+ 97.5530279802174,
+ -8.057161374785466,
+ 62.941297318740425,
+ -48.91555566709158,
+ 91.90643767958213,
+ 46.67098666459884,
+ -74.85331462850246,
+ 30.12636276060539,
+ 26.130894553011203,
+ 59.302706651602165,
+ -60.36199702412532,
+ 18.556152152037427,
+ -88.0373081005649,
+ -26.566773146168643,
+ 70.81292942844541,
+ 9.1056120562301,
+ 56.66746139054709,
+ 21.78444497295007
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "shape": [2, 3, 4],
+ "data": [
+ -1.4057259559631348,
+ 0.5396455526351929,
+ -0.21643976867198944,
+ -0.9825550317764282,
+ 0.7713912725448608,
+ -0.08366990834474564,
+ 1.46259605884552,
+ -0.8138729333877563,
+ 0.7165266871452332,
+ -1.6945916414260864,
+ 1.3408818244934082,
+ 0.3658137917518616,
+ -1.5234858989715576,
+ 0.5162702202796936,
+ 0.43863821029663086,
+ 1.0831668376922607,
+ -1.2419193983078003,
+ 0.29146093130111694,
+ -1.7796510457992554,
+ -0.5852779150009155,
+ 1.3068104982376099,
+ 0.10783683508634567,
+ 1.0319640636444092,
+ 0.35418668389320374
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "layerNormalization float32 4D tensor default options",
+ "inputs": {
+ "input": {
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -35.51446620394829,
+ 54.735407789317094,
+ 19.65901979009459,
+ -15.882677905820188,
+ 65.48657727565143,
+ 25.818493353057278,
+ 97.5530279802174,
+ -8.057161374785466,
+ 62.941297318740425,
+ -48.91555566709158,
+ 91.90643767958213,
+ 46.67098666459884,
+ -74.85331462850246,
+ 30.12636276060539,
+ 26.130894553011203,
+ 59.302706651602165,
+ -60.36199702412532,
+ 18.556152152037427,
+ -88.0373081005649,
+ -26.566773146168643,
+ 70.81292942844541,
+ 9.1056120562301,
+ 56.66746139054709,
+ 21.78444497295007
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -1.4057259559631348,
+ 0.5396455526351929,
+ -0.21643976867198944,
+ -0.9825550317764282,
+ 0.7713912725448608,
+ -0.08366990834474564,
+ 1.46259605884552,
+ -0.8138729333877563,
+ 0.7165266871452332,
+ -1.6945916414260864,
+ 1.3408818244934082,
+ 0.3658137917518616,
+ -1.5234858989715576,
+ 0.5162702202796936,
+ 0.43863821029663086,
+ 1.0831668376922607,
+ -1.2419193983078003,
+ 0.29146093130111694,
+ -1.7796510457992554,
+ -0.5852779150009155,
+ 1.3068104982376099,
+ 0.10783683508634567,
+ 1.0319640636444092,
+ 0.35418668389320374
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "layerNormalization float32 5D tensor default options",
+ "inputs": {
+ "input": {
+ "shape": [2, 1, 2, 2, 3],
+ "data": [
+ -35.51446620394829,
+ 54.735407789317094,
+ 19.65901979009459,
+ -15.882677905820188,
+ 65.48657727565143,
+ 25.818493353057278,
+ 97.5530279802174,
+ -8.057161374785466,
+ 62.941297318740425,
+ -48.91555566709158,
+ 91.90643767958213,
+ 46.67098666459884,
+ -74.85331462850246,
+ 30.12636276060539,
+ 26.130894553011203,
+ 59.302706651602165,
+ -60.36199702412532,
+ 18.556152152037427,
+ -88.0373081005649,
+ -26.566773146168643,
+ 70.81292942844541,
+ 9.1056120562301,
+ 56.66746139054709,
+ 21.78444497295007
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "shape": [2, 1, 2, 2, 3],
+ "data": [
+ -1.4057259559631348,
+ 0.5396455526351929,
+ -0.21643976867198944,
+ -0.9825550317764282,
+ 0.7713912725448608,
+ -0.08366990834474564,
+ 1.46259605884552,
+ -0.8138729333877563,
+ 0.7165266871452332,
+ -1.6945916414260864,
+ 1.3408818244934082,
+ 0.3658137917518616,
+ -1.5234858989715576,
+ 0.5162702202796936,
+ 0.43863821029663086,
+ 1.0831668376922607,
+ -1.2419193983078003,
+ 0.29146093130111694,
+ -1.7796510457992554,
+ -0.5852779150009155,
+ 1.3068104982376099,
+ 0.10783683508634567,
+ 1.0319640636444092,
+ 0.35418668389320374
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "layerNormalization float32 4D tensor options.scale",
+ "inputs": {
+ "input": {
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -35.51446620394829,
+ 54.735407789317094,
+ 19.65901979009459,
+ -15.882677905820188,
+ 65.48657727565143,
+ 25.818493353057278,
+ 97.5530279802174,
+ -8.057161374785466,
+ 62.941297318740425,
+ -48.91555566709158,
+ 91.90643767958213,
+ 46.67098666459884,
+ -74.85331462850246,
+ 30.12636276060539,
+ 26.130894553011203,
+ 59.302706651602165,
+ -60.36199702412532,
+ 18.556152152037427,
+ -88.0373081005649,
+ -26.566773146168643,
+ 70.81292942844541,
+ 9.1056120562301,
+ 56.66746139054709,
+ 21.78444497295007
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "scale": {
+ "shape": [1, 4, 3],
+ "data": [
+ -3.822842326186211,
+ -5.4524582226774365,
+ 0.6776165732478745,
+ -4.027037630534966,
+ -3.7771617295664717,
+ -9.327335252346955,
+ 7.181691199879712,
+ 1.5054303426700422,
+ 3.1208942770408132,
+ 0.5214731591212676,
+ 2.6719749293214345,
+ -3.5713709254192016
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "shape": [2, 1, 4, 3],
+ "data": [
+ 5.373868465423584,
+ -2.942394971847534,
+ -0.14666318893432617,
+ 3.9567861557006836,
+ -2.9136698246002197,
+ 0.780417263507843,
+ 10.503913879394531,
+ -1.225229024887085,
+ 2.236203908920288,
+ -0.8836840987205505,
+ 3.5828025341033936,
+ -1.3064566850662231,
+ 5.824046611785889,
+ -2.814941883087158,
+ 0.29722854495048523,
+ -4.3619537353515625,
+ 4.6909308433532715,
+ -2.7185537815093994,
+ -12.780903816223145,
+ -0.8810951709747314,
+ 4.0784173011779785,
+ 0.05623401328921318,
+ 2.7573819160461426,
+ -1.2649319171905518
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "layerNormalization float32 4D tensor options.bias",
+ "inputs": {
+ "input": {
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -35.51446620394829,
+ 54.735407789317094,
+ 19.65901979009459,
+ -15.882677905820188,
+ 65.48657727565143,
+ 25.818493353057278,
+ 97.5530279802174,
+ -8.057161374785466,
+ 62.941297318740425,
+ -48.91555566709158,
+ 91.90643767958213,
+ 46.67098666459884,
+ -74.85331462850246,
+ 30.12636276060539,
+ 26.130894553011203,
+ 59.302706651602165,
+ -60.36199702412532,
+ 18.556152152037427,
+ -88.0373081005649,
+ -26.566773146168643,
+ 70.81292942844541,
+ 9.1056120562301,
+ 56.66746139054709,
+ 21.78444497295007
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "bias": {
+ "shape": [1, 4, 3],
+ "data": [
+ 7.86298294434458,
+ -3.660304771854861,
+ -6.955524501645973,
+ -6.397322772511171,
+ 3.2689586393414984,
+ -2.7498081789293094,
+ -4.080942283863029,
+ -7.137991900788561,
+ 8.465653688103547,
+ 2.762545157541174,
+ 0.8230442324150911,
+ -3.8275613744392922
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "shape": [2, 1, 4, 3],
+ "data": [
+ 6.45725679397583,
+ -3.120659112930298,
+ -7.171964168548584,
+ -7.37987756729126,
+ 4.040349960327148,
+ -2.8334779739379883,
+ -2.6183459758758545,
+ -7.951864719390869,
+ 9.182180404663086,
+ 1.0679534673690796,
+ 2.163926124572754,
+ -3.461747646331787,
+ 6.339496612548828,
+ -3.1440346240997314,
+ -6.516886234283447,
+ -5.314155578613281,
+ 2.027039051055908,
+ -2.4583470821380615,
+ -5.860593318939209,
+ -7.723269939422607,
+ 9.77246379852295,
+ 2.8703818321228027,
+ 1.8550082445144653,
+ -3.473374605178833
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "layerNormalization float32 4D tensor options.axes=[2]",
+ "inputs": {
+ "input": {
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -35.51446620394829,
+ 54.735407789317094,
+ 19.65901979009459,
+ -15.882677905820188,
+ 65.48657727565143,
+ 25.818493353057278,
+ 97.5530279802174,
+ -8.057161374785466,
+ 62.941297318740425,
+ -48.91555566709158,
+ 91.90643767958213,
+ 46.67098666459884,
+ -74.85331462850246,
+ 30.12636276060539,
+ 26.130894553011203,
+ 59.302706651602165,
+ -60.36199702412532,
+ 18.556152152037427,
+ -88.0373081005649,
+ -26.566773146168643,
+ 70.81292942844541,
+ 9.1056120562301,
+ 56.66746139054709,
+ 21.78444497295007
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "axes": [2]
+ },
+ "expected": {
+ "name": "output",
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -0.6012066006660461,
+ 0.10132180899381638,
+ -1.112992763519287,
+ -0.26228588819503784,
+ 0.3943416476249695,
+ -0.7543209195137024,
+ 1.6960537433624268,
+ -1.6100702285766602,
+ 1.4073745012283325,
+ -0.8325613141059875,
+ 1.114406704902649,
+ 0.45993921160697937,
+ -0.8445013165473938,
+ 0.6554933190345764,
+ -0.3856155574321747,
+ 1.3668763637542725,
+ -1.3111618757247925,
+ -0.7422532439231873,
+ -1.0618212223052979,
+ -0.5766634941101074,
+ 1.7181260585784912,
+ 0.539446234703064,
+ 1.2323321104049683,
+ -0.5902572274208069
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "layerNormalization float32 4D tensor options.epsilon",
+ "inputs": {
+ "input": {
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -35.51446620394829,
+ 54.735407789317094,
+ 19.65901979009459,
+ -15.882677905820188,
+ 65.48657727565143,
+ 25.818493353057278,
+ 97.5530279802174,
+ -8.057161374785466,
+ 62.941297318740425,
+ -48.91555566709158,
+ 91.90643767958213,
+ 46.67098666459884,
+ -74.85331462850246,
+ 30.12636276060539,
+ 26.130894553011203,
+ 59.302706651602165,
+ -60.36199702412532,
+ 18.556152152037427,
+ -88.0373081005649,
+ -26.566773146168643,
+ 70.81292942844541,
+ 9.1056120562301,
+ 56.66746139054709,
+ 21.78444497295007
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "epsilon": 1e-4
+ },
+ "expected": {
+ "name": "output",
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -1.4057258367538452,
+ 0.5396455526351929,
+ -0.21643976867198944,
+ -0.9825550317764282,
+ 0.7713912725448608,
+ -0.08366990089416504,
+ 1.46259605884552,
+ -0.8138729333877563,
+ 0.7165266871452332,
+ -1.6945916414260864,
+ 1.3408817052841187,
+ 0.3658137619495392,
+ -1.5234858989715576,
+ 0.5162702202796936,
+ 0.43863821029663086,
+ 1.0831668376922607,
+ -1.2419193983078003,
+ 0.29146093130111694,
+ -1.7796509265899658,
+ -0.5852779150009155,
+ 1.3068104982376099,
+ 0.10783682763576508,
+ 1.0319639444351196,
+ 0.35418668389320374
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "layerNormalization float32 4D tensor options.scale and options.axes=[0, 2]",
+ "inputs": {
+ "input": {
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -35.51446620394829,
+ 54.735407789317094,
+ 19.65901979009459,
+ -15.882677905820188,
+ 65.48657727565143,
+ 25.818493353057278,
+ 97.5530279802174,
+ -8.057161374785466,
+ 62.941297318740425,
+ -48.91555566709158,
+ 91.90643767958213,
+ 46.67098666459884,
+ -74.85331462850246,
+ 30.12636276060539,
+ 26.130894553011203,
+ 59.302706651602165,
+ -60.36199702412532,
+ 18.556152152037427,
+ -88.0373081005649,
+ -26.566773146168643,
+ 70.81292942844541,
+ 9.1056120562301,
+ 56.66746139054709,
+ 21.78444497295007
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "scale": {
+ "shape": [2, 4],
+ "data": [
+ 8.726573383699723,
+ -5.388210753831433,
+ -6.811323199504957,
+ 4.707905497256553,
+ -4.705779931167426,
+ -5.143046959493542,
+ -1.1115549861715444,
+ 5.250569701742819
+ ],
+ "type": "float32"
+ },
+ "axes": [0, 2]
+ },
+ "expected": {
+ "name": "output",
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -3.3744184970855713,
+ 5.22746467590332,
+ -7.580371856689453,
+ 0.3324689269065857,
+ -4.414334774017334,
+ 2.973374605178833,
+ -12.369945526123047,
+ 4.680946350097656,
+ -9.247408866882324,
+ -2.8648624420166016,
+ 6.40486478805542,
+ 2.4516794681549072,
+ 4.884079456329346,
+ -0.44672244787216187,
+ 2.521172285079956,
+ -6.083702564239502,
+ 9.044846534729004,
+ 4.759283065795898,
+ 1.3962621688842773,
+ 1.185346245765686,
+ -1.959165334701538,
+ 1.8479242324829102,
+ 3.3530402183532715,
+ -3.986907958984375
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "layerNormalization float32 4D tensor options.bias and options.axes=[3, 1, 2]",
+ "inputs": {
+ "input": {
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -35.51446620394829,
+ 54.735407789317094,
+ 19.65901979009459,
+ -15.882677905820188,
+ 65.48657727565143,
+ 25.818493353057278,
+ 97.5530279802174,
+ -8.057161374785466,
+ 62.941297318740425,
+ -48.91555566709158,
+ 91.90643767958213,
+ 46.67098666459884,
+ -74.85331462850246,
+ 30.12636276060539,
+ 26.130894553011203,
+ 59.302706651602165,
+ -60.36199702412532,
+ 18.556152152037427,
+ -88.0373081005649,
+ -26.566773146168643,
+ 70.81292942844541,
+ 9.1056120562301,
+ 56.66746139054709,
+ 21.78444497295007
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "bias": {
+ "shape": [3, 1, 4],
+ "data": [
+ -0.1396923067429423,
+ -6.156772261512771,
+ 4.3632959655495505,
+ 8.859804790093527,
+ 9.772650559072677,
+ -3.4626546514711087,
+ 9.74495010474131,
+ -0.39589682596727016,
+ -8.497353592778571,
+ 6.1725369732984525,
+ -2.893046077750334,
+ 1.7220044503066347
+ ],
+ "type": "float32"
+ },
+ "axes": [3, 1, 2]
+ },
+ "expected": {
+ "name": "output",
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -1.5454182624816895,
+ 10.312295913696289,
+ -8.713793754577637,
+ -7.139327049255371,
+ -2.691263198852539,
+ 6.088866710662842,
+ 5.825891971588135,
+ 8.931077003479004,
+ -2.1765193939208984,
+ 7.165213584899902,
+ 0.9449849724769592,
+ 2.087818145751953,
+ -1.6631782054901123,
+ 10.288921356201172,
+ -8.058714866638184,
+ -5.073605060577393,
+ -4.704574108123779,
+ 6.463997840881348,
+ 2.5836451053619385,
+ 9.159672737121582,
+ -1.5862356424331665,
+ 8.967641830444336,
+ 0.6360672116279602,
+ 2.0761911869049072
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "layerNormalization float32 4D tensor all options",
+ "inputs": {
+ "input": {
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -35.51446620394829,
+ 54.735407789317094,
+ 19.65901979009459,
+ -15.882677905820188,
+ 65.48657727565143,
+ 25.818493353057278,
+ 97.5530279802174,
+ -8.057161374785466,
+ 62.941297318740425,
+ -48.91555566709158,
+ 91.90643767958213,
+ 46.67098666459884,
+ -74.85331462850246,
+ 30.12636276060539,
+ 26.130894553011203,
+ 59.302706651602165,
+ -60.36199702412532,
+ 18.556152152037427,
+ -88.0373081005649,
+ -26.566773146168643,
+ 70.81292942844541,
+ 9.1056120562301,
+ 56.66746139054709,
+ 21.78444497295007
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "scale": {
+ "shape": [2, 3, 1],
+ "data": [
+ 7.715926600551629,
+ 1.737107960115587,
+ 9.139651060226974,
+ 5.7588235611312335,
+ -2.8198351834129154,
+ -0.6866958235000595
+ ],
+ "type": "float32"
+ },
+ "bias": {
+ "shape": [2, 3, 1],
+ "data": [
+ -8.71067229356711,
+ -7.642980873415213,
+ 4.937538370466076,
+ -2.1876746145760695,
+ -4.0676126709354765,
+ -6.83625459268332
+ ],
+ "type": "float32"
+ },
+ "axes": [0, 3, 1],
+ "epsilon": 1e-4
+ },
+ "expected": {
+ "name": "output",
+ "shape": [2, 1, 4, 3],
+ "data": [
+ -15.487034797668457,
+ -5.628695964813232,
+ 8.29687786102295,
+ -14.294686317443848,
+ -5.639192581176758,
+ 7.11608362197876,
+ 0.7769554257392883,
+ -8.346451759338379,
+ 11.279659271240234,
+ -22.506288528442383,
+ -5.173816204071045,
+ 8.506545066833496,
+ -12.360523223876953,
+ -5.77052116394043,
+ -7.18900203704834,
+ 3.6336634159088135,
+ 0.8666883707046509,
+ -6.884884357452393,
+ -11.648612976074219,
+ -2.117840528488159,
+ -7.396423816680908,
+ -4.869131088256836,
+ -5.8111701011657715,
+ -6.714934349060059
+ ],
+ "type": "float32"
+ }
+ }
+ ]
+} \ No newline at end of file