diff --git a/js/web/test/data/ops/multihead-attention.jsonc b/js/web/test/data/ops/multihead-attention.jsonc index ed937a22c0b84..9ae866327b3f2 100644 --- a/js/web/test/data/ops/multihead-attention.jsonc +++ b/js/web/test/data/ops/multihead-attention.jsonc @@ -1073,5 +1073,80 @@ ] } ] + }, + { + "name": "MultiHeadAttention Basic, one head and head-size=1 with empty pastKey, pastValue inputs and optional presentKey, presentValue outputs", + "operator": "MultiHeadAttention", + "opset": { "domain": "com.microsoft", "version": 1 }, + "attributes": [{ "name": "num_heads", "data": 1, "type": "int" }], + "cases": [ + { + "name": "T[0]", + "inputs": [ + // Q + { + "data": [1], + "dims": [1, 1, 1], + "type": "float32" + }, + // K + { + "data": [2], + "dims": [1, 1, 1], + "type": "float32" + }, + // V + { + "data": [3], + "dims": [1, 1, 1], + "type": "float32" + }, + // Bias + { + "data": null, + "type": "float32" + }, + // Mask + { + "data": null, + "type": "int32" + }, + // AttentionBias + { + "data": null, + "type": "float32" + }, + // PastKey + { + "data": [], + "dims": [1, 1, 0, 1], + "type": "float32" + }, + // PastValue + { + "data": [], + "dims": [1, 1, 0, 1], + "type": "float32" + } + ], + "outputs": [ + { + "data": [3], + "dims": [1, 1, 1], + "type": "float32" + }, + { + "data": [2], + "dims": [1, 1, 1, 1], + "type": "float32" + }, + { + "data": [3], + "dims": [1, 1, 1, 1], + "type": "float32" + } + ] + } + ] } ]