Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
qjia7 committed Sep 4, 2024
1 parent 9955b36 commit 7030e9b
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions js/web/test/data/ops/transpose.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,78 @@
}
]
},
{
"name": "Transpose squeezed 2d - perms:[0, 2, 1, 3]",
"operator": "Transpose",
"attributes": [{ "name": "perm", "data": [0, 2, 1, 3], "type": "ints" }],
"cases": [
{
"name": "T[1, 3 , 4, 1]",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
"dims": [1, 3, 4, 1],
"type": "float32"
}
],
"outputs": [
{
"data": [1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8, 12],
"dims": [1, 4, 3, 1],
"type": "float32"
}
]
}
]
},
{
"name": "Transpose 4D channelsFirst - perms:[0, 3, 1, 2]",
"operator": "Transpose",
"attributes": [{ "name": "perm", "data": [0, 3, 1, 2], "type": "ints" }],
"cases": [
{
"name": "T[1, 2, 3, 4]",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
"dims": [1, 2, 3, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [1, 5, 9, 13, 17, 21, 2, 6, 10, 14, 18, 22, 3, 7, 11, 15, 19, 23, 4, 8, 12, 16, 20, 24],
"dims": [1, 4, 2, 3],
"type": "float32"
}
]
}
]
},
{
"name": "Transpose 4D channelsLast - perms:[0, 2, 3, 1]",
"operator": "Transpose",
"attributes": [{ "name": "perm", "data": [0, 2, 3, 1], "type": "ints" }],
"cases": [
{
"name": "T[1, 2, 3, 4]",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
"dims": [1, 2, 3, 4],
"type": "float32"
}
],
"outputs": [
{
"data": [1, 13, 2, 14, 3, 15, 4, 16, 5, 17, 6, 18, 7, 19, 8, 20, 9, 21, 10, 22, 11, 23, 12, 24],
"dims": [1, 3, 4, 2],
"type": "float32"
}
]
}
]
},
{
"name": "Transpose 5D - perms:[4, 3, 1, 0, 2]",
"operator": "Transpose",
Expand Down

0 comments on commit 7030e9b

Please sign in to comment.