mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
This is to fix issue #21703, where the axis is a negative value in the model. According to the spec (https://onnx.ai/onnx/operators/onnx__Split.html), negative axis means counting dimensions from the back.
101 lines
2.3 KiB
Text
101 lines
2.3 KiB
Text
[
|
|
{
|
|
"name": "Split on Axis 0",
|
|
"operator": "Split",
|
|
"opset": { "domain": "", "version": 12 },
|
|
"attributes": [
|
|
{ "name": "axis", "data": 0, "type": "int" },
|
|
{ "name": "split", "data": [2, 4], "type": "ints" }
|
|
],
|
|
"cases": [
|
|
{
|
|
"name": "T[6]",
|
|
"inputs": [
|
|
{
|
|
"data": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0],
|
|
"dims": [6],
|
|
"type": "float32"
|
|
}
|
|
],
|
|
"outputs": [
|
|
{
|
|
"data": [1.0, 2.0],
|
|
"dims": [2],
|
|
"type": "float32"
|
|
},
|
|
{
|
|
"data": [3.0, 4.0, 5.0, 6.0],
|
|
"dims": [4],
|
|
"type": "float32"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Split on Axis 1 - 2D",
|
|
"operator": "Split",
|
|
"opset": { "domain": "", "version": 12 },
|
|
"attributes": [
|
|
{ "name": "axis", "data": 1, "type": "int" },
|
|
{ "name": "split", "data": [2, 4], "type": "ints" }
|
|
],
|
|
"cases": [
|
|
{
|
|
"name": "T[6]",
|
|
"inputs": [
|
|
{
|
|
"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": [2, 6],
|
|
"type": "float32"
|
|
}
|
|
],
|
|
"outputs": [
|
|
{
|
|
"data": [1.0, 2.0, 7.0, 8.0],
|
|
"dims": [2, 2],
|
|
"type": "float32"
|
|
},
|
|
{
|
|
"data": [3.0, 4.0, 5.0, 6.0, 9.0, 10.0, 11.0, 12.0],
|
|
"dims": [2, 4],
|
|
"type": "float32"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Split on Axis -1 - 2D",
|
|
"operator": "Split",
|
|
"opset": { "domain": "", "version": 12 },
|
|
"attributes": [
|
|
{ "name": "axis", "data": -1, "type": "int" },
|
|
{ "name": "split", "data": [2, 4], "type": "ints" }
|
|
],
|
|
"cases": [
|
|
{
|
|
"name": "T[6]",
|
|
"inputs": [
|
|
{
|
|
"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": [2, 6],
|
|
"type": "float32"
|
|
}
|
|
],
|
|
"outputs": [
|
|
{
|
|
"data": [1.0, 2.0, 7.0, 8.0],
|
|
"dims": [2, 2],
|
|
"type": "float32"
|
|
},
|
|
{
|
|
"data": [3.0, 4.0, 5.0, 6.0, 9.0, 10.0, 11.0, 12.0],
|
|
"dims": [2, 4],
|
|
"type": "float32"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|