Skip to content

Commit 83ee953

Browse files
Copilotjustinchuby
andcommitted
Fix aten_copy to wrap CastLike with Identity to prevent IR value aliasing
Agent-Logs-Url: https://github.com/microsoft/onnxscript/sessions/452e0b6d-caee-4be8-8b46-2609a538fa73 Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
1 parent 4c17aff commit 83ee953

File tree

1 file changed

+1
-1
lines changed
  • onnxscript/function_libs/torch_lib/ops

1 file changed

+1
-1
lines changed

onnxscript/function_libs/torch_lib/ops/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2515,7 +2515,7 @@ def aten_copy(
25152515
) -> TTensor:
25162516
"""copy(Tensor self, Tensor src, bool non_blocking=False) -> Tensor"""
25172517

2518-
return op.CastLike(src, self)
2518+
return op.Identity(op.CastLike(src, self))
25192519

25202520

25212521
@torch_op("aten::_to_copy", trace_only=True)

0 commit comments

Comments
 (0)