File size: 17,567 Bytes
e17c874
 
 
 
 
 
 
 
 
 
 
df95636
e17c874
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
df95636
e17c874
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
df95636
e17c874
 
 
 
 
 
 
 
df95636
e17c874
 
 
 
 
 
 
 
 
df95636
e17c874
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
df95636
e17c874
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4091d81
e17c874
 
 
 
 
 
 
 
 
4091d81
e17c874
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4091d81
e17c874
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4091d81
e17c874
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4091d81
e17c874
 
 
 
 
 
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
{
  "usageCase": "zero_default",
  "cases": [
    {
      "name": "zero_default",
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } } },
      "outputs": { "output": { "dtype": "float32", "shape": [2, 3] } }
    },
    {
      "name": "f32_vec4_fill_4096",
      "provenance": {
        "notes": "A compact vec4-aligned float32 output exercises flat ConstantOfShape filling without benchmark-scale storage."
      },
      "attrs": { "value": -10000 },
      "inputs": { "input": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [4096] } } },
      "outputs": { "output": { "dtype": "float32", "shape": [4096], "tolerance": 0 } }
    },
    {
      "name": "f32_subnormal_fill_value",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.Float_Ones",
        "notes": "Valid float32 fill value below the normal range; the uniform-to-storage fill path must preserve finite subnormal payloads."
      },
      "attrs": { "value": 1e-40 },
      "inputs": { "input": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [4] } } },
      "outputs": {
        "output": {
          "dtype": "float32",
          "shape": [4],
          "tolerance": 0,
          "data": { "kind": "values", "values": [1e-40, 1e-40, 1e-40, 1e-40] }
        }
      }
    },
    {
      "name": "f32_positive_infinity_fill",
      "attrs": { "value": "Infinity" },
      "inputs": { "input": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [4] } } },
      "outputs": {
        "output": {
          "dtype": "float32",
          "shape": [4],
          "data": { "kind": "values", "values": ["Infinity", "Infinity", "Infinity", "Infinity"] }
        }
      }
    },
    {
      "name": "f32_negative_infinity_fill",
      "attrs": { "value": "-Infinity" },
      "inputs": { "input": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [3] } } },
      "outputs": {
        "output": {
          "dtype": "float32",
          "shape": [3],
          "data": { "kind": "values", "values": ["-Infinity", "-Infinity", "-Infinity"] }
        }
      }
    },
    {
      "name": "f16_fill",
      "attrs": { "value": 1.5 },
      "inputs": { "input": { "dtype": "uint32", "shape": [3], "data": { "kind": "values", "values": [1, 2, 4] } } },
      "outputs": { "output": { "dtype": "float16", "shape": [1, 2, 4] } },
      "tolerance": 0.001
    },
    {
      "name": "scalar_output_empty_shape",
      "attrs": { "value": -4.25 },
      "inputs": { "input": { "dtype": "uint32", "shape": [0], "data": { "kind": "values", "values": [] } } },
      "outputs": { "output": { "dtype": "float32", "shape": [], "tolerance": 0.000001 } }
    },
    {
      "name": "rank7_output_fill",
      "attrs": { "value": -2.75 },
      "inputs": {
        "input": { "dtype": "uint32", "shape": [7], "data": { "kind": "values", "values": [1, 2, 1, 3, 1, 2, 2] } }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [1, 2, 1, 3, 1, 2, 2], "tolerance": 0.000001 } }
    },
    {
      "name": "zero_sized_output_fill",
      "attrs": { "value": 6.5 },
      "inputs": { "input": { "dtype": "uint32", "shape": [3], "data": { "kind": "values", "values": [2, 0, 3] } } },
      "outputs": { "output": { "dtype": "float32", "shape": [2, 0, 3], "tolerance": 0.000001 } }
    },
    {
      "name": "ort_int32_zeros_10x6",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.Int32_Zeros"
      },
      "attrs": { "value": 0 },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [10, 6] } } },
      "outputs": { "output": { "dtype": "int32", "shape": [10, 6], "tolerance": 0 } }
    },
    {
      "name": "int32_negative_fill_exact",
      "attrs": { "value": -17 },
      "inputs": { "input": { "dtype": "uint32", "shape": [3], "data": { "kind": "values", "values": [2, 1, 3] } } },
      "outputs": { "output": { "dtype": "int32", "shape": [2, 1, 3], "tolerance": 0 } }
    },
    {
      "name": "uint32_fill_exact_above_float24",
      "attrs": { "value": 16777217 },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } } },
      "outputs": { "output": { "dtype": "uint32", "shape": [2, 3], "tolerance": 0 } }
    },
    {
      "name": "ort_float_ones_4x3x2",
      "attrs": { "value": 1 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.Float_Ones"
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [3], "data": { "kind": "values", "values": [4, 3, 2] } } },
      "outputs": { "output": { "dtype": "float32", "shape": [4, 3, 2], "tolerance": 0 } }
    },
    {
      "name": "ort_default_value_float_zeros_2x6",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.DefaultValue"
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 6] } } },
      "outputs": { "output": { "dtype": "float32", "shape": [2, 6], "tolerance": 0 } }
    },
    {
      "name": "ort_type_test_float16_bits_value",
      "attrs": { "value": 2.980232238769531e-7 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.TypeTests",
        "notes": "FLOAT16 typed value from raw bits 5, represented as its numeric half value."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 6] } } },
      "outputs": { "output": { "dtype": "float16", "shape": [2, 6], "tolerance": 0 } }
    },
    {
      "name": "ort_type_test_uint32_2x6",
      "attrs": { "value": 32 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.TypeTests",
        "notes": "UINT32 typed value."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 6] } } },
      "outputs": { "output": { "dtype": "uint32", "shape": [2, 6], "tolerance": 0 } }
    },
    {
      "name": "ort_type_test_int32_exact_above_float24",
      "attrs": { "value": 20000001 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.TypeTests",
        "notes": "INT32 typed value variant extended above f32's exact integer range."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } } },
      "outputs": { "output": { "dtype": "int32", "shape": [2, 3], "tolerance": 0 } }
    },
    {
      "name": "ort_type_test_int16_2x6",
      "attrs": { "value": 16 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.TypeTests",
        "notes": "INT16 typed value from ORT's ConstantOfShape TypeTests."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 6] } } },
      "outputs": { "output": { "dtype": "int16", "shape": [2, 6], "tolerance": 0 } }
    },
    {
      "name": "ort_type_test_int16_min_fill",
      "attrs": { "value": -32768 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.TypeTests",
        "notes": "Signed int16 sentinel extension of ORT's typed ConstantOfShape TypeTests."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } } },
      "outputs": {
        "output": {
          "dtype": "int16",
          "shape": [2, 3],
          "data": { "kind": "values", "values": [-32768, -32768, -32768, -32768, -32768, -32768] },
          "tolerance": 0
        }
      }
    },
    {
      "name": "ort_type_test_uint32_large_exact",
      "attrs": { "value": 4000000001 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.TypeTests",
        "notes": "UINT32 typed value variant extended above f32's exact integer range."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } } },
      "outputs": { "output": { "dtype": "uint32", "shape": [2, 3], "tolerance": 0 } }
    },
    {
      "name": "ort_type_test_int8_min_fill",
      "attrs": { "value": -128 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.TypeTests",
        "notes": "Exercises the same typed TensorProto value path as ORT's int8 TypeTests with a signed edge value."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 6] } } },
      "outputs": { "output": { "dtype": "int8", "shape": [2, 6], "tolerance": 0 } }
    },
    {
      "name": "ort_type_test_uint8_high_fill",
      "attrs": { "value": 250 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.TypeTests",
        "notes": "Exercises the same typed TensorProto value path as ORT's uint8 TypeTests with a high logical byte value."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 6] } } },
      "outputs": { "output": { "dtype": "uint8", "shape": [2, 6], "tolerance": 0 } }
    },
    {
      "name": "bool_true_fill",
      "attrs": { "value": 1 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc",
        "test": "ConstantOfShape.TypeTests",
        "notes": "A scalar true value must fill every element of the logical bool output."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 3] } } },
      "outputs": {
        "output": {
          "dtype": "bool",
          "shape": [2, 3],
          "data": { "kind": "values", "values": [1, 1, 1, 1, 1, 1] },
          "tolerance": 0
        }
      }
    },
    {
      "name": "onnx_backend_constantofshape_float_ones",
      "inputs": { "input": { "dtype": "uint32", "shape": [3], "data": { "kind": "values", "values": [4, 3, 2] } } },
      "outputs": { "output": { "dtype": "float32", "shape": [4, 3, 2] } },
      "provenance": {
        "source": "cmake/external/onnx/onnx/backend/test/data/node/test_constantofshape_float_ones",
        "notes": "The integer shape tensor exactly represents the source ONNX int64 dimensions."
      }
    },
    {
      "name": "onnx_backend_constantofshape_int_shape_zero",
      "inputs": { "input": { "dtype": "uint32", "shape": [1], "data": { "kind": "values", "values": [0] } } },
      "outputs": { "output": { "dtype": "int32", "shape": [0] } },
      "provenance": {
        "source": "cmake/external/onnx/onnx/backend/test/data/node/test_constantofshape_int_shape_zero",
        "notes": "The integer shape tensor exactly represents the source ONNX int64 dimensions, and the scalar `value` attribute represents the single-element ONNX value tensor."
      },
      "attrs": { "value": 0 }
    },
    {
      "name": "onnx_backend_constantofshape_int_zeros",
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [10, 6] } } },
      "outputs": { "output": { "dtype": "int32", "shape": [10, 6] } },
      "provenance": {
        "source": "cmake/external/onnx/onnx/backend/test/data/node/test_constantofshape_int_zeros",
        "notes": "The integer shape tensor exactly represents the source ONNX int64 dimensions, and the scalar `value` attribute represents the single-element ONNX value tensor."
      },
      "attrs": { "value": 0 }
    },
    {
      "name": "rank8_output_scalar_fill",
      "attrs": { "value": 3.5 },
      "provenance": {
        "source": "onnx spec: ConstantOfShape output rank = len(shape input), unbounded",
        "notes": "Fills a rank-8 tensor with the scalar float32 value 3.5."
      },
      "inputs": {
        "input": { "dtype": "uint32", "shape": [8], "data": { "kind": "values", "values": [2, 1, 2, 1, 2, 1, 2, 1] } }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [2, 1, 2, 1, 2, 1, 2, 1], "tolerance": 0 } }
    },
    {
      "name": "rank8_output_oddnumel_fill",
      "attrs": { "value": -1.25 },
      "provenance": {
        "source": "onnx spec: ConstantOfShape arbitrary output rank",
        "notes": "A rank-8 float32 output with 18 elements requires the scalar fill path because its element count is not divisible by four. The expected output is the requested shape filled uniformly with the attribute value."
      },
      "inputs": {
        "input": { "dtype": "uint32", "shape": [8], "data": { "kind": "values", "values": [2, 1, 3, 1, 1, 3, 1, 1] } }
      },
      "outputs": { "output": { "dtype": "float32", "shape": [2, 1, 3, 1, 1, 3, 1, 1], "tolerance": 0 } }
    },
    {
      "name": "f16_oddnumel_scalar_fill",
      "attrs": { "value": -2.5 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc (TypeTests float16)",
        "notes": "A 15-element float16 output exercises the scalar fill path because its element count is not divisible by four. The value is exactly representable in float16."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [3, 5] } } },
      "outputs": { "output": { "dtype": "float16", "shape": [3, 5], "tolerance": 0.001 } }
    },
    {
      "name": "u32_oddnumel_scalar_fill",
      "attrs": { "value": 7 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc (TypeTests uint32)",
        "notes": "A 15-element uint32 output checks the final three-element tail after four-wide groups."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [3, 5] } } },
      "outputs": { "output": { "dtype": "uint32", "shape": [3, 5], "tolerance": 0 } }
    },
    {
      "name": "int32_vec4_fill_16m_2dfold_correctness",
      "attrs": { "value": 123456789 },
      "provenance": {
        "source": "onnx spec: ConstantOfShape flat memset; 2D dispatch-fold guard",
        "notes": "An 8,192 x 8,192 int32 output has 67,108,864 elements; every element, including those in the final row, must equal 123456789."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [8192, 8192] } } },
      "outputs": {
        "output": {
          "dtype": "int32",
          "shape": [8192, 8192],
          "data": { "kind": "constant", "value": 123456789 },
          "tolerance": 0
        }
      }
    },
    {
      "name": "i32_vec4_min_int32_fill_exact",
      "attrs": { "value": -2147483648 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc (TypeTests int32) extended to INT32_MIN",
        "notes": "Eight int32 outputs must all equal the signed minimum value -2147483648 exactly."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 4] } } },
      "outputs": {
        "output": {
          "dtype": "int32",
          "shape": [2, 4],
          "data": {
            "kind": "values",
            "values": [-2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648]
          },
          "tolerance": 0
        }
      }
    },
    {
      "name": "u32_vec4_max_uint32_fill_exact",
      "attrs": { "value": 4294967295 },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/generator/constant_of_shape_test.cc (TypeTests uint32) extended to UINT32_MAX",
        "notes": "Eight uint32 outputs must all retain the exact unsigned maximum value 4294967295 without a float32 round-trip."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [2], "data": { "kind": "values", "values": [2, 4] } } },
      "outputs": {
        "output": {
          "dtype": "uint32",
          "shape": [2, 4],
          "data": {
            "kind": "values",
            "values": [4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, 4294967295]
          },
          "tolerance": 0
        }
      }
    },
    {
      "name": "i32_vec4_dim1_first_zero_sized_output",
      "attrs": { "value": -17 },
      "provenance": {
        "source": "onnx spec: ConstantOfShape with a zero extent -> empty output; array<T,0> compile-crash class",
        "notes": "Shape [0,5,3] has zero elements; setup must handle the leading zero extent without dispatch or invalid array construction."
      },
      "inputs": { "input": { "dtype": "uint32", "shape": [3], "data": { "kind": "values", "values": [0, 5, 3] } } },
      "outputs": { "output": { "dtype": "int32", "shape": [0, 5, 3], "tolerance": 0 } }
    }
  ]
}