Skip to content

Commit

Permalink
Added Upsample test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
satyajandhyala committed Dec 19, 2023
1 parent d38c1f7 commit 2856e30
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
102 changes: 102 additions & 0 deletions js/web/test/data/ops/upsample.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"name": "Upsample - Nearest",
"operator": "Upsample",
"opset": { "domain": "", "version": 7 },
"attributes": [{ "name": "scales", "data": [1.0, 1.0, 2.0, 3.0], "type": "floats" }],
"cases": [
{
Expand Down Expand Up @@ -32,6 +33,7 @@
{
"name": "Upsample - Nearest2X",
"operator": "Upsample",
"opset": { "domain": "", "version": 7 },
"attributes": [{ "name": "scales", "data": [1.0, 1.0, 2.0, 2.0], "type": "floats" }],
"cases": [
{
Expand Down Expand Up @@ -60,6 +62,7 @@
{
"name": "Upsample - Nearest222X",
"operator": "Upsample",
"opset": { "domain": "", "version": 7 },
"attributes": [{ "name": "scales", "data": [2.0, 1.0, 2.0, 2.0], "type": "floats" }],
"cases": [
{
Expand Down Expand Up @@ -92,6 +95,7 @@
{
"name": "Upsample - Nearest15X",
"operator": "Upsample",
"opset": { "domain": "", "version": 7 },
"attributes": [{ "name": "scales", "data": [1.0, 1.0, 2.0, 1.5], "type": "floats" }],
"cases": [
{
Expand Down Expand Up @@ -120,6 +124,7 @@
{
"name": "Upsample - Nearest_NoScale",
"operator": "Upsample",
"opset": { "domain": "", "version": 7 },
"attributes": [
{ "name": "scales", "data": [1.0, 1.0, 1.0, 1.0], "type": "floats" },
{ "name": "mode", "data": "nearest", "type": "string" }
Expand Down Expand Up @@ -147,6 +152,7 @@
{
"name": "Upsample - 4D Bilinear",
"operator": "Upsample",
"opset": { "domain": "", "version": 7 },
"attributes": [
{ "name": "scales", "data": [1.0, 1.0, 2.0, 4.0], "type": "floats" },
{ "name": "mode", "data": "linear", "type": "string" }
Expand Down Expand Up @@ -180,6 +186,7 @@
{
"name": "Upsample - 2D Bilinear",
"operator": "Upsample",
"opset": { "domain": "", "version": 7 },
"attributes": [
{ "name": "scales", "data": [2.0, 4.0], "type": "floats" },
{ "name": "mode", "data": "linear", "type": "string" }
Expand Down Expand Up @@ -210,6 +217,7 @@
{
"name": "Upsample - 4D Bilinear ScalesNoOp",
"operator": "Upsample",
"opset": { "domain": "", "version": 7 },
"attributes": [
{ "name": "scales", "data": [1.0, 1.0, 1.0, 1.0], "type": "floats" },
{ "name": "mode", "data": "linear", "type": "string" }
Expand Down Expand Up @@ -237,6 +245,7 @@
{
"name": "Upsample - 1D Nearest",
"operator": "Upsample",
"opset": { "domain": "", "version": 7 },
"attributes": [
{ "name": "scales", "data": [2.0], "type": "floats" },
{ "name": "mode", "data": "nearest", "type": "string" }
Expand All @@ -260,5 +269,98 @@
]
}
]
},
{
"name": "Upsample - 5D Trilinear",
"operator": "Upsample",
"opset": { "domain": "", "version": 7 },
"attributes": [
{ "name": "scales", "data": [1.0, 1.0, 1.0, 2.0, 4.0], "type": "floats" },
{ "name": "mode", "data": "linear", "type": "string" }
],
"cases": [
{
"name": "X",
"inputs": [
{
"data": [1.0, 3.0, 3.0, 5.0, 3.0, 5.0, 7.0, 9.0],
"dims": [1, 2, 1, 2, 2],
"type": "float32"
}
],
"outputs": [
{
"data": [
1.0, 1.5, 2.0, 2.5, 3.0, 3.0, 3.0, 3.0, 2.0, 2.5, 3.0, 3.5, 4.0, 4.0, 4.0, 4.0, 3.0, 3.5, 4.0, 4.5, 5.0,
5.0, 5.0, 5.0, 3.0, 3.5, 4.0, 4.5, 5.0, 5.0, 5.0, 5.0,

3.0, 3.5, 4.0, 4.5, 5.0, 5.0, 5.0, 5.0, 5.0, 5.5, 6.0, 6.5, 7.0, 7.0, 7.0, 7.0, 7.0, 7.5, 8.0, 8.5, 9.0,
9.0, 9.0, 9.0, 7.0, 7.5, 8.0, 8.5, 9.0, 9.0, 9.0, 9.0
],
"dims": [1, 2, 1, 4, 8],
"type": "float32"
}
]
}
]
},
{
"name": "Upsample - 3D Trilinear",
"operator": "Upsample",
"opset": { "domain": "", "version": 7 },
"attributes": [
{ "name": "scales", "data": [1.0, 2.0, 4.0], "type": "floats" },
{ "name": "mode", "data": "linear", "type": "string" }
],
"cases": [
{
"name": "X",
"inputs": [
{
"data": [1.0, 3.0, 3.0, 5.0],
"dims": [1, 2, 2],
"type": "float32"
}
],
"outputs": [
{
"data": [
1.0, 1.5, 2.0, 2.5, 3.0, 3.0, 3.0, 3.0, 2.0, 2.5, 3.0, 3.5, 4.0, 4.0, 4.0, 4.0, 3.0, 3.5, 4.0, 4.5, 5.0,
5.0, 5.0, 5.0, 3.0, 3.5, 4.0, 4.5, 5.0, 5.0, 5.0, 5.0
],
"dims": [1, 4, 8],
"type": "float32"
}
]
}
]
},
{
"name": "Upsample - 3D Trilinear ScalesNoOp",
"operator": "Upsample",
"opset": { "domain": "", "version": 7 },
"attributes": [
{ "name": "scales", "data": [1.0, 1.0, 1.0], "type": "floats" },
{ "name": "mode", "data": "linear", "type": "string" }
],
"cases": [
{
"name": "X",
"inputs": [
{
"data": [1.0, 3.0, 3.0, 5.0, 3.0, 5.0, 7.0, 9.0],
"dims": [2, 2, 2],
"type": "float32"
}
],
"outputs": [
{
"data": [1.0, 3.0, 3.0, 5.0, 3.0, 5.0, 7.0, 9.0],
"dims": [2, 2, 2],
"type": "float32"
}
]
}
]
}
]
1 change: 1 addition & 0 deletions js/web/test/suite-test-list.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,7 @@
"tile.jsonc",
"transpose.jsonc",
"transpose_int32_uint32.jsonc",
"upsample.jsonc"
"where.jsonc"
// Turn on this when https://github.com/microsoft/onnxruntime/issues/17405 is fixed.
//"where_broadcast.jsonc",
Expand Down

0 comments on commit 2856e30

Please sign in to comment.