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: 1 addition & 3 deletions onnxscript/optimizer/_constant_folding.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,7 @@ def cast(node: ir.Node, op, state: OptimizerState) -> ReturnValue:
# should handle this. Only the optimization to eliminate redundant Cast ops
# should be needed here.

input_shape = input.shape
if input_shape is not None:
output.shape = input_shape.copy()
output.shape = _merge_shapes(output.shape, input.shape)

input_dtype = _get_input_element_type(node, 0)
output_dtype = _get_int_attribute(node, "to", None)
Expand Down