onnxruntime/js/web/test/data/ops/einsum.jsonc
satyajandhyala 7335760424
[JS/Web] Add uniforms to Einsum (#18531)
### Description
Add uinforms to Einsum



### 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. -->
Improve performance.
2023-11-29 15:30:33 -08:00

959 lines
18 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 elements dot product",
"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": "diagonal elements 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": [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,ij -> ij",
"type": "string"
}
],
"cases": [
{
"name": "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": [1, 0, 0, 0, 5, 0, 0, 0, 9],
"dims": [3, 3],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "i,i",
"type": "string"
}
],
"cases": [
{
"name": "Dot product/scalar product",
"inputs": [
{
"data": [1, 2, 3],
"dims": [3],
"type": "float32"
},
{
"data": [1, 1, 1],
"dims": [3],
"type": "float32"
}
],
"outputs": [
{
"data": [6],
"dims": [],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "i,j->ij",
"type": "string"
}
],
"cases": [
{
"name": "outer product",
"inputs": [
{
"data": [1, 2, 3],
"dims": [3],
"type": "float32"
},
{
"data": [1, 2, 3],
"dims": [3],
"type": "float32"
}
],
"outputs": [
{
"data": [1, 2, 3, 2, 4, 6, 3, 6, 9],
"dims": [3, 3],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "ij,ij -> ij",
"type": "string"
}
],
"cases": [
{
"name": "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": [1, 0, 0, 0, 5, 0, 0, 0, 9],
"dims": [3, 3],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "i,i",
"type": "string"
}
],
"cases": [
{
"name": "Dot product/scalar product",
"inputs": [
{
"data": [1, 2, 3],
"dims": [3],
"type": "float32"
},
{
"data": [1, 1, 1],
"dims": [3],
"type": "float32"
}
],
"outputs": [
{
"data": [6],
"dims": [],
"type": "float32"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "i,j->ij",
"type": "string"
}
],
"cases": [
{
"name": "outer product",
"inputs": [
{
"data": [1, 2, 3],
"dims": [3],
"type": "float32"
},
{
"data": [1, 2, 3],
"dims": [3],
"type": "float32"
}
],
"outputs": [
{
"data": [1, 2, 3, 2, 4, 6, 3, 6, 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 (2,3) X (3,4) -> (2,4)",
"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": "Multiply (2,6) X (6,4) -> (2,4)",
"inputs": [
{
"data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
"dims": [2, 6],
"type": "float32"
},
{
"data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
"dims": [6, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [220, 235, 250, 265, 580, 631, 682, 733],
"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"
}
]
}
]
},
{
"name": "einsum",
"operator": "Einsum",
"opset": {
"domain": "",
"version": 12
},
"attributes": [
{
"name": "equation",
"data": "ijk->ikj",
"type": "string"
}
],
"cases": [
{
"name": "Transpose with 3 dims",
"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->...ji",
"type": "string"
}
],
"cases": [
{
"name": "Transpose with ellipsis with input/output dims > 4",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6],
"dims": [1, 1, 1, 2, 3],
"type": "float32"
}
],
"outputs": [
{
"data": [1, 4, 2, 5, 3, 6],
"dims": [1, 1, 1, 3, 2],
"type": "float32"
}
]
}
]
}
]