From 57363435dc03d3fd81db25bf6bd292917b4c339d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Aug 2026 19:35:17 +0000 Subject: [PATCH 1/2] Initial plan From 33bda6b330f3679de2293e787ed216098ec8ff75 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Aug 2026 19:39:18 +0000 Subject: [PATCH 2/2] Use Clip for aten::relu6 ONNX export Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com> --- onnxscript/function_libs/torch_lib/ops/nn.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/onnxscript/function_libs/torch_lib/ops/nn.py b/onnxscript/function_libs/torch_lib/ops/nn.py index a37c48f259..5721783a67 100644 --- a/onnxscript/function_libs/torch_lib/ops/nn.py +++ b/onnxscript/function_libs/torch_lib/ops/nn.py @@ -1595,8 +1595,9 @@ def aten_relu(self: TReal) -> TReal: def aten_relu6(self: TReal) -> TReal: """relu6(Tensor self) -> Tensor""" + zero = op.CastLike(op.Constant(value_int=0), self) six = op.CastLike(op.Constant(value_int=6), self) - return op.Min(op.Relu(self), six) + return op.Clip(self, zero, six) @torch_op("aten::replication_pad1d", trace_only=True)