onnxruntime/js/web/test/data/ops/conv.jsonc
Jiajia Qin fc8631e2f1
[js/web] Fix conv2dMatmul errors due to #18452 (#18562)
### Description
Currently, all conv2dMatmul with inChannels = 3 and outChannels % 4 = 0
will report compilation errors. Models, which include this kind of shape
will be impacted, like mobilenetv2-12, resnet50 .

The errors is introduced by #18452
https://github.com/microsoft/onnxruntime/pull/18452/files#diff-8b24ea43aa11b1346c0c9e327f9bce6b37a93bd8f2bf8a6392b2b263972b7ea2R200,
which accidentally pass `components` to `x`. But `x`'s components is
`innerElementSize` not `components `. And when `innerElementSize` is 3,
we should use `1` in current design.
2023-11-27 21:21:47 -08:00

339 lines
8.7 KiB
Text

[
{
"name": "conv without bias addition A",
"operator": "Conv",
"attributes": [{ "name": "kernel_shape", "data": [2, 2], "type": "ints" }],
"cases": [
{
"name": "T[0]",
"inputs": [
{
"data": [10, 20, 30, 40, 50, 60, 70, 80, 90],
"dims": [1, 1, 3, 3],
"type": "float32"
},
{
"data": [1, 2, 3, 4],
"dims": [1, 1, 2, 2],
"type": "float32"
}
],
"outputs": [
{
"data": [370, 470, 670, 770],
"dims": [1, 1, 2, 2],
"type": "float32"
}
]
}
]
},
{
"name": "Conv without bias addition B",
"operator": "Conv",
"attributes": [{ "name": "kernel_shape", "data": [2, 2], "type": "ints" }],
"cases": [
{
"name": "T[0]",
"inputs": [
{
"data": [10, 20, 30, 40, 50, 60, 70, 80],
"dims": [1, 2, 2, 2],
"type": "float32"
},
{
"data": [1, 2, 3, 4, 5, 6, 7, 8],
"dims": [1, 2, 2, 2],
"type": "float32"
}
],
"outputs": [
{
"data": [2040],
"dims": [1, 1, 1, 1],
"type": "float32"
}
]
}
]
},
{
"name": "Conv with bias addition A",
"operator": "Conv",
"attributes": [{ "name": "kernel_shape", "data": [2, 2], "type": "ints" }],
"cases": [
{
"name": "T[0]",
"inputs": [
{
"data": [10, 20, 30, 40, 50, 60, 70, 80],
"dims": [1, 2, 2, 2],
"type": "float32"
},
{
"data": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
"dims": [4, 2, 2, 2],
"type": "float32"
},
{
"data": [0.1, 0.2, 0.3, 0.4],
"dims": [4],
"type": "float32"
}
],
"outputs": [
{
"data": [360.1, 360.2, 360.3, 360.4],
"dims": [1, 4, 1, 1],
"type": "float32"
}
]
}
]
},
{
"name": "conv with bias addition B",
"operator": "Conv",
"attributes": [{ "name": "kernel_shape", "data": [2, 2], "type": "ints" }],
"cases": [
{
"name": "T[0]",
"inputs": [
{
"data": [1, 2, 3, 4],
"dims": [1, 1, 2, 2],
"type": "float32"
},
{
"data": [1, 1, 1, 1],
"dims": [1, 1, 2, 2],
"type": "float32"
},
{
"data": [5],
"dims": [1],
"type": "float32"
}
],
"outputs": [
{
"data": [15],
"dims": [1, 1, 1, 1],
"type": "float32"
}
]
}
]
},
{
"name": "conv with bias addition C - NHWC",
"operator": "Conv",
"inputShapeDefinitions": "rankOnly",
"opset": { "domain": "", "version": 17 },
"attributes": [{ "name": "kernel_shape", "data": [2, 2], "type": "ints" }],
"cases": [
{
"name": "T[0]",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
"dims": [3, 1, 2, 2],
"type": "float32"
},
{
"data": [1, 1, 1, 1, 2, 3, 4, 5],
"dims": [2, 1, 2, 2],
"type": "float32"
},
{
"data": [5, 6],
"dims": [2],
"type": "float32"
}
],
"outputs": [
{
"data": [15, 46, 31, 102, 47, 158],
"dims": [3, 2, 1, 1],
"type": "float32"
}
]
},
{
"name": "inChannel = 3, outChannel = 4",
"inputs": [
{
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 10],
"dims": [1, 3, 3, 3],
"type": "float32"
},
{
"data": [
1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 1, 2, 3, 4, 5, 6, 7, 8
],
"dims": [4, 3, 2, 2],
"type": "float32"
},
{
"data": [5, 6, 7, 8],
"dims": [4],
"type": "float32"
}
],
"outputs": [
{
"data": [360, 334, 271, 323, 909, 963, 1024, 1028, 683, 655, 576, 650, 473, 508, 570, 677],
"dims": [1, 4, 2, 2],
"type": "float32"
}
]
}
]
},
{
"name": "conv - group - A",
"operator": "Conv",
"attributes": [
{ "name": "kernel_shape", "data": [1, 1], "type": "ints" },
{ "name": "group", "data": 2, "type": "int" }
],
"cases": [
{
"name": "T[0]",
"inputs": [
{
"data": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0],
"dims": [1, 2, 3, 3],
"type": "float32"
},
{
"data": [1.0, 2.0],
"dims": [2, 1, 1, 1],
"type": "float32"
}
],
"outputs": [
{
"data": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 18.0, 20.0, 22.0, 24.0, 26.0, 28.0, 30.0, 32.0, 34.0],
"dims": [1, 2, 3, 3],
"type": "float32"
}
]
}
]
},
{
"name": "conv - group - B",
"operator": "Conv",
"attributes": [
{ "name": "kernel_shape", "data": [2, 2], "type": "ints" },
{ "name": "group", "data": 3, "type": "int" }
],
"cases": [
{
"name": "T[0]",
"inputs": [
{
"data": [
0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0,
19.0, 20.0, 21.0, 22.0, 23.0, 0, 0, 0
],
"dims": [1, 3, 3, 3],
"type": "float32"
},
{
"data": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0],
"dims": [3, 1, 2, 2],
"type": "float32"
},
{
"data": [0.1, 0.2, 0.3],
"dims": [3],
"type": "float32"
}
],
"outputs": [
{
"data": [27.1, 37.1, 57.1, 67.1, 293.2, 319.2, 371.2, 397.2, 847.3, 889.3, 409.3, 428.3],
"dims": [1, 3, 2, 2],
"type": "float32"
}
]
}
]
},
{
"name": "conv - group - C",
"operator": "Conv",
"attributes": [
{ "name": "kernel_shape", "data": [2, 2], "type": "ints" },
{ "name": "group", "data": 3, "type": "int" }
],
"cases": [
{
"name": "T[0]",
"inputs": [
{
"data": [
0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0,
19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0
],
"dims": [1, 3, 3, 4],
"type": "float32"
},
{
"data": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0],
"dims": [3, 1, 2, 2],
"type": "float32"
}
],
"outputs": [
{
"data": [34, 44, 54, 74, 84, 94, 386, 412, 438, 490, 516, 542, 1122, 1164, 1206, 1290, 1332, 1374],
"dims": [1, 3, 2, 3],
"type": "float32"
}
]
}
]
},
{
"name": "conv - pointwise",
"operator": "Conv",
"attributes": [{ "name": "kernel_shape", "data": [1, 1], "type": "ints" }],
"cases": [
{
"name": "T[0]",
"inputs": [
{
"data": [
0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0,
19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0
],
"dims": [1, 8, 2, 2],
"type": "float32"
},
{
"data": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0],
"dims": [2, 8, 1, 1],
"type": "float32"
},
{
"data": [0.5, 0.4],
"dims": [2],
"type": "float32"
}
],
"outputs": [
{
"data": [560.5, 588.5, 616.5, 644.5, 1456.4, 1548.4, 1640.4, 1732.4],
"dims": [1, 2, 2, 2],
"type": "float32"
}
]
}
]
}
]