Skip to content

Commit fe152d4

Browse files
authored
Correctly create empty ints for Constant in rewriter (#2497)
Due to changes onnx/ir-py#148, we cannot create an empty list attribute without specifying type because it would be ambiguous. Fix #2496 Signed-off-by: Justin Chu <[email protected]>
1 parent 73d6134 commit fe152d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

onnxscript/rewriter/ort_fusions/shape_optimization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def rewrite(self, op, dim0, dim1, dim2, dim3, **_):
5555
transposed_dims = [dim0, dim2, dim1, dim3]
5656
sliced_result = transposed_dims[self._start_val : self._end_val]
5757
if len(sliced_result) == 0:
58-
return op.Constant(value_ints=[])
58+
return op.Constant(value_ints=ir.AttrInt64s("value_ints", []))
5959
if len(sliced_result) == 1:
6060
return op.Identity(sliced_result[0])
6161
return op.Concat(*sliced_result, axis=0)

0 commit comments

Comments
 (0)