onnxruntime/js/web/test/data/ops/einsum.jsonc
satyajandhyala bf6d6961cc
[JS/Web] Added Einsum operator support. (#17401)
### Description
Added Einsum operator support to JSEP.



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
2023-09-11 15:57:15 -07:00

635 lines
12 KiB
Text

[
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "i,i",
"type": "string"
}
],
"cases": [
{
"name": "Dotproduct/scalar product",
"inputs": [
{
"data": [1, 2, 3],
"dims": [3],
"type": "float32"
},
{
"data": [4, 5, 6],
"dims": [3],
"type": "float32"
}
],
"outputs": [
{
"data": [32],
"dims": [],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "i,i->i",
"type": "string"
}
],
"cases": [
{
"name": "elementwise product",
"inputs": [
{
"data": [1, 2, 3],
"dims": [3],
"type": "float32"
},
{
"data": [4, 5, 6],
"dims": [3],
"type": "float32"
}
],
"outputs": [
{
"data": [4, 10, 18],
"dims": [3],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "i,j",
"type": "string"
}
],
"cases": [
{
"name": "Product without specifying RSH",
"inputs": [
{
"data": [1, 2, 3],
"dims": [3],
"type": "float32"
},
{
"data": [4, 5, 6],
"dims": [3],
"type": "float32"
}
],
"outputs": [
{
"data": [4, 5, 6, 8, 10, 12, 12, 15, 18],
"dims": [3, 3],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "i,j->ij",
"type": "string"
}
],
"cases": [
{
"name": "Product",
"inputs": [
{
"data": [1, 2, 3],
"dims": [3],
"type": "float32"
},
{
"data": [4, 5, 6],
"dims": [3],
"type": "float32"
}
],
"outputs": [
{
"data": [4, 5, 6, 8, 10, 12, 12, 15, 18],
"dims": [3, 3],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "ii,jj",
"type": "string"
}
],
"cases": [
{
"name": "Diagonal elementwise multiplication",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9],
"dims": [3, 3],
"type": "float32"
},
{
"data": [1, 0, 0, 0, 1, 0, 0, 0, 1],
"dims": [3, 3],
"type": "float32"
}
],
"outputs": [
{
"data": [45],
"dims": [],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "ii,jj -> ij",
"type": "string"
}
],
"cases": [
{
"name": "Dotproduct",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9],
"dims": [3, 3],
"type": "float32"
},
{
"data": [1, 0, 0, 0, 1, 0, 0, 0, 1],
"dims": [3, 3],
"type": "float32"
}
],
"outputs": [
{
"data": [1, 1, 1, 5, 5, 5, 9, 9, 9],
"dims": [3, 3],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "ij,jk->ik",
"type": "string"
}
],
"cases": [
{
"name": "Multiply",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6],
"dims": [2, 3],
"type": "float32"
},
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
"dims": [3, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [38, 44, 50, 56, 83, 98, 113, 128],
"dims": [2, 4],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "ij->ji",
"type": "string"
}
],
"cases": [
{
"name": "Transpose",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6],
"dims": [2, 3],
"type": "float32"
}
],
"outputs": [
{
"data": [1, 4, 2, 5, 3, 6],
"dims": [3, 2],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "ij->i",
"type": "string"
}
],
"cases": [
{
"name": "ReduceSum",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9],
"dims": [3, 3],
"type": "float32"
}
],
"outputs": [
{
"data": [6, 15, 24],
"dims": [3],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "ii->i",
"type": "string"
}
],
"cases": [
{
"name": "Diagonal",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9],
"dims": [3, 3],
"type": "float32"
}
],
"outputs": [
{
"data": [1, 5, 9],
"dims": [3],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "ij...,jk...->ik...",
"type": "string"
}
],
"cases": [
{
"name": "Multiply with ellipsis - A",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6],
"dims": [2, 3, 1],
"type": "float32"
},
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
"dims": [3, 4, 1],
"type": "float32"
}
],
"outputs": [
{
"data": [38, 44, 50, 56, 83, 98, 113, 128],
"dims": [2, 4, 1],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "...ij,...jk->...ik",
"type": "string"
}
],
"cases": [
{
"name": "Multiply with ellipsis - B",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6],
"dims": [1, 2, 3],
"type": "float32"
},
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
"dims": [1, 3, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [38, 44, 50, 56, 83, 98, 113, 128],
"dims": [1, 2, 4],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "i...j,j...k->i...k",
"type": "string"
}
],
"cases": [
{
"name": "Multiply with ellipsis - C",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6],
"dims": [2, 1, 3],
"type": "float32"
},
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
"dims": [3, 1, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [38, 44, 50, 56, 83, 98, 113, 128],
"dims": [2, 1, 4],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "...ij,jk->...ik",
"type": "string"
}
],
"cases": [
{
"name": "Multiply with ellipsis - D",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6],
"dims": [1, 2, 3],
"type": "float32"
},
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
"dims": [3, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [38, 44, 50, 56, 83, 98, 113, 128],
"dims": [1, 2, 4],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "...ij->...ji",
"type": "string"
}
],
"cases": [
{
"name": "Transpose with ellipsis",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6],
"dims": [1, 2, 3],
"type": "float32"
}
],
"outputs": [
{
"data": [1, 4, 2, 5, 3, 6],
"dims": [1, 3, 2],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "...ij->...i",
"type": "string"
}
],
"cases": [
{
"name": "ReduceSum with ellipsis",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9],
"dims": [1, 3, 3],
"type": "float32"
}
],
"outputs": [
{
"data": [6, 15, 24],
"dims": [1, 3],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "...ii->...i",
"type": "string"
}
],
"cases": [
{
"name": "Diagonal with ellipsis",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9],
"dims": [1, 3, 3],
"type": "float32"
}
],
"outputs": [
{
"data": [1, 5, 9],
"dims": [1, 3],
"type": "float32"
}
]
}
]
}
]