File size: 12,227 Bytes
b1ec92f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | {
"op": "ai.onnx.If",
"cases": [
{
"name": "lowered_dispatch_cliff_select_then",
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [1] } },
"then_value": { "dtype": "float32", "shape": [16777216], "data": { "kind": "constant", "value": 1.5 } },
"else_value": { "dtype": "float32", "shape": [16777216], "data": { "kind": "constant", "value": -2.5 } }
},
"outputs": { "y": { "dtype": "float32", "shape": [16777216], "tolerance": 0 } }
},
{
"name": "lowered_select_then",
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [1] } },
"then_value": {
"dtype": "float32",
"shape": [2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] }
},
"else_value": {
"dtype": "float32",
"shape": [2, 2],
"data": { "kind": "values", "values": [-1.0, -2.0, -3.0, -4.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2] } }
},
{
"name": "lowered_select_else",
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [0] } },
"then_value": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [10.0, 20.0, 30.0] } },
"else_value": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [4.0, 5.0, 6.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [3] } }
},
{
"name": "lowered_ort_projection_outer_scope_add_then",
"provenance": {
"source": "onnxruntime/test/providers/cpu/controlflow/if_test.cc",
"test": "If.ShapeInMainGraph_NoShapeInSubgraph_True",
"notes": "Projection onto the framework's lowered select variant: ORT's then branch computes split_out_0 + if_graph_input_0 = 2."
},
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [1] } },
"then_value": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [2.0] } },
"else_value": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [11.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [1], "tolerance": 0 } }
},
{
"name": "lowered_ort_projection_outer_scope_add_else",
"provenance": {
"source": "onnxruntime/test/providers/cpu/controlflow/if_test.cc",
"test": "If.ShapeInMainGraph_NoShapeInSubgraph_False",
"notes": "Projection onto the framework's lowered select variant: ORT's else branch computes split_out_1 + if_graph_input_0 = 11."
},
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [0] } },
"then_value": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [2.0] } },
"else_value": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [11.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [1], "tolerance": 0 } }
},
{
"name": "lowered_ort_projection_constant_then_branch",
"provenance": {
"source": "onnxruntime/test/providers/cpu/controlflow/if_test.cc",
"test": "If.ConditionalBranchesOnlyContainConstantNodes_ThenBranchExecution",
"notes": "Projection onto the framework's lowered select variant: branch subgraphs are represented by precomputed branch tensors."
},
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [1] } },
"then_value": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [10.0] } },
"else_value": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1000.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [1] } }
},
{
"name": "lowered_ort_projection_constant_else_branch",
"provenance": {
"source": "onnxruntime/test/providers/cpu/controlflow/if_test.cc",
"test": "If.ConditionalBranchesOnlyContainConstantNodes_ElseBranchExecution",
"notes": "Projection onto the framework's lowered select variant: branch subgraphs are represented by precomputed branch tensors."
},
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [0] } },
"then_value": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [10.0] } },
"else_value": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1000.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [1] } }
},
{
"name": "lowered_ort_projection_different_branch_shapes_then",
"provenance": {
"source": "onnxruntime/test/providers/cpu/controlflow/if_test.cc",
"test": "If.Opset11ThenAndElseBranchesProduceDifferentOutputShapes",
"notes": "Projection onto the framework's lowered select variant: branch tensors use different ranks with equal storage size, and the selected then branch fixes the output shape."
},
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [1] } },
"then_value": {
"dtype": "float32",
"shape": [2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] }
},
"else_value": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "values", "values": [-1.0, -2.0, -3.0, -4.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2] } }
},
{
"name": "lowered_ort_projection_different_branch_shapes_else",
"provenance": {
"source": "onnxruntime/test/providers/cpu/controlflow/if_test.cc",
"test": "If.Opset11ThenAndElseBranchesProduceDifferentOutputShapes",
"notes": "Projection onto the framework's lowered select variant: branch tensors use different ranks with equal storage size, and the selected else branch fixes the output shape."
},
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [0] } },
"then_value": {
"dtype": "float32",
"shape": [2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] }
},
"else_value": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "values", "values": [-1.0, -2.0, -3.0, -4.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [4] } }
},
{
"name": "lowered_select_then_scalar",
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [1] } },
"then_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [42.0] } },
"else_value": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-42.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [] } }
},
{
"name": "lowered_scalar_cond_then",
"provenance": {
"source": "onnxruntime/test/providers/cpu/controlflow/if_test.cc",
"test": "If.ConditionalBranchesOnlyContainConstantNodes_ThenBranchExecution",
"notes": "ONNX If condition is a scalar bool. The project-lowered select form should accept scalar logical uint32 conditions as well as [1] conditions."
},
"inputs": {
"cond": { "dtype": "uint32", "shape": [], "data": { "kind": "values", "values": [1] } },
"then_value": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [9.0, -3.0] } },
"else_value": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [4.0, 5.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2], "tolerance": 0 } }
},
{
"name": "lowered_scalar_cond_else",
"provenance": {
"source": "onnxruntime/test/providers/cpu/controlflow/if_test.cc",
"test": "If.ConditionalBranchesOnlyContainConstantNodes_ElseBranchExecution",
"notes": "ONNX If condition is a scalar bool. This exercises the false branch with scalar logical uint32 condition storage."
},
"inputs": {
"cond": { "dtype": "uint32", "shape": [], "data": { "kind": "values", "values": [0] } },
"then_value": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [9.0, -3.0] } },
"else_value": { "dtype": "float32", "shape": [2], "data": { "kind": "values", "values": [4.0, 5.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2], "tolerance": 0 } }
},
{
"name": "lowered_bool_scalar_cond_then",
"provenance": {
"source": "onnxruntime/test/providers/cpu/controlflow/if_test.cc",
"test": "If.ConditionalBranchesOnlyContainConstantNodes_ThenBranchExecution",
"notes": "ONNX If conditions are bool tensors. This lowered projection verifies scalar logical bool storage selects the then branch."
},
"inputs": {
"cond": { "dtype": "bool", "shape": [], "data": { "kind": "values", "values": [1] } },
"then_value": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1.25, -2.5, 3.75] } },
"else_value": {
"dtype": "float32",
"shape": [3],
"data": { "kind": "values", "values": [-10.0, -20.0, -30.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0 } }
},
{
"name": "lowered_bool_len1_cond_else",
"provenance": {
"source": "onnxruntime/test/providers/cpu/controlflow/if_test.cc",
"test": "If.ConditionalBranchesOnlyContainConstantNodes_ElseBranchExecution",
"notes": "Length-1 logical bool condition companion for the lowered select form; false must select the else tensor exactly."
},
"inputs": {
"cond": { "dtype": "bool", "shape": [1], "data": { "kind": "values", "values": [0] } },
"then_value": {
"dtype": "float32",
"shape": [2, 2],
"data": { "kind": "values", "values": [9.0, 8.0, 7.0, 6.0] }
},
"else_value": {
"dtype": "float32",
"shape": [2, 2],
"data": { "kind": "values", "values": [-1.0, -2.0, -3.0, -4.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2], "tolerance": 0 } }
},
{
"name": "lowered_select_else_zero_sized",
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [0] } },
"then_value": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } },
"else_value": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [0] } }
},
{
"name": "lowered_noncanonical_cond_uint32_42_selects_then",
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [42] } },
"then_value": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "values", "values": [3.0, 1.5, -2.5, 0.25] }
},
"else_value": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "values", "values": [-9.0, 7.0, 4.25, -1.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [4], "tolerance": 0 } }
},
{
"name": "lowered_noncanonical_cond_uint32_max_selects_then",
"inputs": {
"cond": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [4294967295] } },
"then_value": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [10.0, -5.0, 0.5] } },
"else_value": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [0.0, 0.0, 0.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0 } }
}
]
}
|