Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions onnxscript/optimizer/_constant_folding.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def gather(node: ir.Node, op, state: OptimizerState) -> ReturnValue:
if output is not None:
state.set_sym_value(output, ir.Shape(gathered))
if all(isinstance(d, int) for d in gathered):
return op.Constant(value_ints=gathered)
return op.Constant(value_ints=ir.AttrInt64s("value_ints", gathered))
return None


Expand Down Expand Up @@ -466,7 +466,7 @@ def shape(node: ir.Node, op, state: OptimizerState) -> ReturnValue:
if output is not None:
state.set_sym_value(output, ir.Shape(shape_slice))
if all(isinstance(d, int) for d in shape_slice):
return op.Constant(value_ints=list(shape_slice))
return op.Constant(value_ints=ir.AttrInt64s("value_ints", list(shape_slice)))
return None


Expand Down
Loading